Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. vector math/cross product

vector math/cross product

Scheduled Pinned Locked Moved The Lounge
questiongraphicscareerlearning
51 Posts 20 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Marc Clifton

    Jeremy Falcon wrote:

    Now I wish I had graph paper.

    Huh. All this technology, and I've never seen virtual graph paper. An ideal, simple, yet powerful application. Extensible. Hmmm.... Marc Pensieve Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson

    J Offline
    J Offline
    Jeremy Falcon
    wrote on last edited by
    #6

    And much easier to see in 3D. Come to think of it, it would make a nice starter OGL project and probably one that I would use. Of course, if you have the itchin' by all means. :laugh: Jeremy Falcon

    1 Reply Last reply
    0
    • J Jeremy Falcon

      I really don't want to ask this question here, but since there's no math forum I haven't much of a choice. Anyway, I have a math question for the gurus again. I'm trying to understand just how a cross product works rather than just do as I'm told kinda thing. So, given this...

      | x1 | | x2 | | y1z2 - z1y2 |
      | y1 | x | y2 | = | z1x2 - x1z2 |
      | z1 | | z2 | | x1y2 - y1x2 |

      My question is, why is that so? I realize (using the dot product as a reference) that the elements are independent or so I thought. I would've thought that multiplying the two would mean somethign of this nature...

      x1 * x2 + y1 * y2, etc.

      But I realize that would just be the dot product again. Also, why do I need to subtract at all when multiplying? Can anyone please explain this to me? The book I'm reading did a great job at explaining the dot product, but not the cross product. TIA Jeremy Falcon

      A Offline
      A Offline
      Andy Brummer
      wrote on last edited by
      #7

      Ah, where to start. The traditional cross product produces the vector perpendicular to the plane through the two vectors that you are multipling with a length equal to the area of the parallelogram defined by the vectors. (There are actually 2 vectors that meet this criteria, by default we choose one of them) The cross product only works in 3 dimensions. In 2D there isn't a perpendicular direction, and in higher then 3 dimensions there is more then just one perpendicular direction. For all these cases it makes more sense to use a bi-vector product which represents the plane directly instead of trying to map it to a vector.


      I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

      J 1 Reply Last reply
      0
      • A Andy Brummer

        Ah, where to start. The traditional cross product produces the vector perpendicular to the plane through the two vectors that you are multipling with a length equal to the area of the parallelogram defined by the vectors. (There are actually 2 vectors that meet this criteria, by default we choose one of them) The cross product only works in 3 dimensions. In 2D there isn't a perpendicular direction, and in higher then 3 dimensions there is more then just one perpendicular direction. For all these cases it makes more sense to use a bi-vector product which represents the plane directly instead of trying to map it to a vector.


        I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

        J Offline
        J Offline
        Jeremy Falcon
        wrote on last edited by
        #8

        Andy Brummer wrote:

        The traditional cross product produces the vector perpendicular to the plane through the two vectors that you are multipling

        Yeah I just got to that. It's amazing what graph paper can do. :-D Ok, you sound like you know this stuff, so what is the cross product used for in practical terms? The dot product I can envision being used when transforming objects easy enough, but is there some things useful for this for the direction I'm headed in (OGL programming)? Thanks for the reply! Jeremy Falcon

        S M A 4 Replies Last reply
        0
        • J Jeremy Falcon

          Andy Brummer wrote:

          The traditional cross product produces the vector perpendicular to the plane through the two vectors that you are multipling

          Yeah I just got to that. It's amazing what graph paper can do. :-D Ok, you sound like you know this stuff, so what is the cross product used for in practical terms? The dot product I can envision being used when transforming objects easy enough, but is there some things useful for this for the direction I'm headed in (OGL programming)? Thanks for the reply! Jeremy Falcon

          S Offline
          S Offline
          Shog9 0
          wrote on last edited by
          #9

          Jeremy Falcon wrote:

          what is the cross product used for in practical terms?

          Consider this: you can take two vectors on a surface, that'll tell you what plane the surface resides on. Find the cross product of those, and you can decide whether or not the surface is facing the "camera"... if it's not, don't bother drawing it. Handy, eh? (you can also use it for calculating lighting / shading, or drawing nifty arrows sticking out of a surface... if you're into that sort of thing.)

          ---- Scripts i’ve known... CPhog 1.0.0.0 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums

          J 1 Reply Last reply
          0
          • J Jeremy Falcon

            Andy Brummer wrote:

            The traditional cross product produces the vector perpendicular to the plane through the two vectors that you are multipling

            Yeah I just got to that. It's amazing what graph paper can do. :-D Ok, you sound like you know this stuff, so what is the cross product used for in practical terms? The dot product I can envision being used when transforming objects easy enough, but is there some things useful for this for the direction I'm headed in (OGL programming)? Thanks for the reply! Jeremy Falcon

            M Offline
            M Offline
            Michael A Barnhart
            wrote on last edited by
            #10

            Jeremy Falcon wrote:

            but is there some things useful for this

            Many, depending on what you goals are. A) you know know the normal vector to the surface you are working with. Take that with one of the existing vector to produce a third vector and you have the local coordinate system that plane is in. B) with the normal vector of the plan you can calculate the distance an abritrary point in space is from the plane. and on and on. "Yes I know the voices are not real. But they have some pretty good ideas."

            J 1 Reply Last reply
            0
            • J Jeremy Falcon

              I really don't want to ask this question here, but since there's no math forum I haven't much of a choice. Anyway, I have a math question for the gurus again. I'm trying to understand just how a cross product works rather than just do as I'm told kinda thing. So, given this...

              | x1 | | x2 | | y1z2 - z1y2 |
              | y1 | x | y2 | = | z1x2 - x1z2 |
              | z1 | | z2 | | x1y2 - y1x2 |

              My question is, why is that so? I realize (using the dot product as a reference) that the elements are independent or so I thought. I would've thought that multiplying the two would mean somethign of this nature...

              x1 * x2 + y1 * y2, etc.

              But I realize that would just be the dot product again. Also, why do I need to subtract at all when multiplying? Can anyone please explain this to me? The book I'm reading did a great job at explaining the dot product, but not the cross product. TIA Jeremy Falcon

              T Offline
              T Offline
              Todd Smith
              wrote on last edited by
              #11

              http://mathworld.wolfram.com/CrossProduct.html[^] Todd Smith

              J 1 Reply Last reply
              0
              • S Shog9 0

                Jeremy Falcon wrote:

                what is the cross product used for in practical terms?

                Consider this: you can take two vectors on a surface, that'll tell you what plane the surface resides on. Find the cross product of those, and you can decide whether or not the surface is facing the "camera"... if it's not, don't bother drawing it. Handy, eh? (you can also use it for calculating lighting / shading, or drawing nifty arrows sticking out of a surface... if you're into that sort of thing.)

                ---- Scripts i’ve known... CPhog 1.0.0.0 - make CP better. Forum Bookmark 0.2.5 - bookmark forum posts on Pensieve Print forum 0.1.2 - printer-friendly forums Expand all 1.0 - Expand all messages In-place Delete 1.0 - AJAX-style post delete Syntax 0.1 - Syntax highlighting for code blocks in the forums

                J Offline
                J Offline
                Jeremy Falcon
                wrote on last edited by
                #12

                Shog9 wrote:

                you can take two vectors on a surface, that'll tell you what plane the surface resides on. Find the cross product of those, and you can decide whether or not the surface is facing the "camera"... if it's not, don't bother drawing it. Handy, eh?

                How is that any different than a normal though? (And if this a stupid question, well oops :-O). Nevermind I just got it. The facing the camera part was what I missed. Thanks man. Jeremy Falcon

                1 Reply Last reply
                0
                • M Michael A Barnhart

                  Jeremy Falcon wrote:

                  but is there some things useful for this

                  Many, depending on what you goals are. A) you know know the normal vector to the surface you are working with. Take that with one of the existing vector to produce a third vector and you have the local coordinate system that plane is in. B) with the normal vector of the plan you can calculate the distance an abritrary point in space is from the plane. and on and on. "Yes I know the voices are not real. But they have some pretty good ideas."

                  J Offline
                  J Offline
                  Jeremy Falcon
                  wrote on last edited by
                  #13

                  Michael A. Barnhart wrote:

                  you know know the normal vector to the surface you are working with. Take that with one of the existing vector to produce a third vector and you have the local coordinate system that plane is in.

                  Hot damn! I'm not finished with this book yet (page 77 of 449), so I'm mainly curious. But that is extremely useful! Thanks! Jeremy Falcon

                  V 1 Reply Last reply
                  0
                  • T Todd Smith

                    http://mathworld.wolfram.com/CrossProduct.html[^] Todd Smith

                    J Offline
                    J Offline
                    Jeremy Falcon
                    wrote on last edited by
                    #14

                    I found that site a while back on a Google frenzy. The concept is nice but their "answers" are no less confusing than hieroglyphics. The only people that understand what they say are the people that don't need to ask the question in the first place. Thanks for the reply. Jeremy Falcon

                    J J 2 Replies Last reply
                    0
                    • M Marc Clifton

                      Jeremy Falcon wrote:

                      Now I wish I had graph paper.

                      Huh. All this technology, and I've never seen virtual graph paper. An ideal, simple, yet powerful application. Extensible. Hmmm.... Marc Pensieve Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson

                      C Offline
                      C Offline
                      code frog 0
                      wrote on last edited by
                      #15

                      Visio.


                      "You have an arrow in your butt!" - Fiona:cool:
                      Welcome to CP in your language. Post the unicode version in My CP Blog [ ^ ] now.

                      People who don't understand how awesome Firefox is have never used CPhog[^]CPhog. The act of using CPhog (Firefox)[^] alone doesn't make Firefox cool. It opens your eyes to the possibilities and then you start looking for other things like CPhog (Firefox)[^] and your eyes are suddenly open to all sorts of useful things all through Firefox. - (Self Quote)

                      1 Reply Last reply
                      0
                      • J Jeremy Falcon

                        I found that site a while back on a Google frenzy. The concept is nice but their "answers" are no less confusing than hieroglyphics. The only people that understand what they say are the people that don't need to ask the question in the first place. Thanks for the reply. Jeremy Falcon

                        J Offline
                        J Offline
                        J Dunlap
                        wrote on last edited by
                        #16

                        Jeremy Falcon wrote:

                        The only people that understand what they say are the people that don't need to ask the question in the first place.

                        I know how that goes... :sigh:

                        J 1 Reply Last reply
                        0
                        • J J Dunlap

                          Jeremy Falcon wrote:

                          The only people that understand what they say are the people that don't need to ask the question in the first place.

                          I know how that goes... :sigh:

                          J Offline
                          J Offline
                          Jeremy Falcon
                          wrote on last edited by
                          #17

                          J. Dunlap wrote:

                          I know how that goes...

                          It's sad really. Some people like to get off by acting smarter than they really are by trying to sound difficult to understand. I've seen that a LOT by some people with studying 3D math. It drives me crazy(er). Of course, I don't think that site is really geared towards those who are learning. It's really more of a reference for those who have IMO. Jeremy Falcon

                          1 Reply Last reply
                          0
                          • M Marc Clifton

                            Jeremy Falcon wrote:

                            Now I wish I had graph paper.

                            Huh. All this technology, and I've never seen virtual graph paper. An ideal, simple, yet powerful application. Extensible. Hmmm.... Marc Pensieve Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson

                            J Offline
                            J Offline
                            Jim Crafton
                            wrote on last edited by
                            #18

                            Hey, a project that would be cool to use the VCF for! :) ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF!

                            1 Reply Last reply
                            0
                            • M Marc Clifton

                              Jeremy Falcon wrote:

                              Now I wish I had graph paper.

                              Huh. All this technology, and I've never seen virtual graph paper. An ideal, simple, yet powerful application. Extensible. Hmmm.... Marc Pensieve Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson

                              E Offline
                              E Offline
                              Ed Poore
                              wrote on last edited by
                              #19

                              Marc Clifton wrote:

                              All this technology, and I've never seen virtual graph paper.

                              AutoCAD?

                              Marc Clifton wrote:

                              An ideal

                              Yes

                              Marc Clifton wrote:

                              simple

                              No

                              Marc Clifton wrote:

                              powerful

                              Certainly

                              Marc Clifton wrote:

                              Extensible

                              Yes (but if only you could use C#...)

                              1 Reply Last reply
                              0
                              • J Jeremy Falcon

                                Andy Brummer wrote:

                                The traditional cross product produces the vector perpendicular to the plane through the two vectors that you are multipling

                                Yeah I just got to that. It's amazing what graph paper can do. :-D Ok, you sound like you know this stuff, so what is the cross product used for in practical terms? The dot product I can envision being used when transforming objects easy enough, but is there some things useful for this for the direction I'm headed in (OGL programming)? Thanks for the reply! Jeremy Falcon

                                A Offline
                                A Offline
                                Andy Brummer
                                wrote on last edited by
                                #20

                                Finding the normal direction for a plane is the most common use. In addition to what Josh and others have said, not only can you use it for culling, but you can use it for lighting calculations and reflection angle. Also it is used for Snell's law for translucent objects. In basic physics it is used for all sorts of electromagneic, fluid flow and other calculations of that sort. It can also be used to find vectors in the same plane as your original vectors using (a x b) * x = 0 since this implies x = x0 a + x1 b where x is the vector you are checking. It can be really useful in 3 dimensions, but doesn't extend to higher dimensions and is harder to remember the formula for. It's too bad there isn't more info on bivectors out there.


                                I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                                J 1 Reply Last reply
                                0
                                • A Andy Brummer

                                  Finding the normal direction for a plane is the most common use. In addition to what Josh and others have said, not only can you use it for culling, but you can use it for lighting calculations and reflection angle. Also it is used for Snell's law for translucent objects. In basic physics it is used for all sorts of electromagneic, fluid flow and other calculations of that sort. It can also be used to find vectors in the same plane as your original vectors using (a x b) * x = 0 since this implies x = x0 a + x1 b where x is the vector you are checking. It can be really useful in 3 dimensions, but doesn't extend to higher dimensions and is harder to remember the formula for. It's too bad there isn't more info on bivectors out there.


                                  I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                                  J Offline
                                  J Offline
                                  Jeremy Falcon
                                  wrote on last edited by
                                  #21

                                  Andy Brummer wrote:

                                  Also it is used for Snell's law for translucent objects.

                                  That's cool to know.

                                  Andy Brummer wrote:

                                  It's too bad there isn't more info on bivectors out there.

                                  Well for me, I'm staying within the realm of 3d for now until the concepts are easy as pie. Perhaps then I'll move on to the harder stuff. Thanks for the reply... again. Jeremy Falcon

                                  1 Reply Last reply
                                  0
                                  • J Jeremy Falcon

                                    I found that site a while back on a Google frenzy. The concept is nice but their "answers" are no less confusing than hieroglyphics. The only people that understand what they say are the people that don't need to ask the question in the first place. Thanks for the reply. Jeremy Falcon

                                    J Offline
                                    J Offline
                                    Jorgen Sigvardsson
                                    wrote on last edited by
                                    #22

                                    I wish I saved my old algebra notes from the university courses I took 11 years ago. I distinctly remember that the cross product really isn't that hard to grasp. Perhaps you know someone who's in college, taking algebra classes?

                                    -- 100% natural. No superstitious additives.

                                    J 1 Reply Last reply
                                    0
                                    • J Jeremy Falcon

                                      Andy Brummer wrote:

                                      The traditional cross product produces the vector perpendicular to the plane through the two vectors that you are multipling

                                      Yeah I just got to that. It's amazing what graph paper can do. :-D Ok, you sound like you know this stuff, so what is the cross product used for in practical terms? The dot product I can envision being used when transforming objects easy enough, but is there some things useful for this for the direction I'm headed in (OGL programming)? Thanks for the reply! Jeremy Falcon

                                      M Offline
                                      M Offline
                                      Michael A Barnhart
                                      wrote on last edited by
                                      #23

                                      Jeremy Falcon wrote:

                                      for the direction I'm headed in (OGL programming)?

                                      Actually Jeremy, you need to answer most of this question for yourself. I believe you will when you are ready. My point here is: Ok, you are going to visually display something. What is to be displayed and why is it important or entertaining to bother displaying what ever it is. When you answer that/those questions, you will start saying, now if I new this, I can answer that. Just one word of advise, do not start using a left handed coordinate system, just because you got tired one night. "Yes I know the voices are not real. But they have some pretty good ideas."

                                      S J 2 Replies Last reply
                                      0
                                      • J Jorgen Sigvardsson

                                        I wish I saved my old algebra notes from the university courses I took 11 years ago. I distinctly remember that the cross product really isn't that hard to grasp. Perhaps you know someone who's in college, taking algebra classes?

                                        -- 100% natural. No superstitious additives.

                                        J Offline
                                        J Offline
                                        Jeremy Falcon
                                        wrote on last edited by
                                        #24

                                        Jörgen Sigvardsson wrote:

                                        Perhaps you know someone who's in college, taking algebra classes?

                                        No need. I got it now. I think main problem for me was I wasn't graphing it. Sometimes it helps to see it before it clicks. Jeremy Falcon

                                        1 Reply Last reply
                                        0
                                        • M Marc Clifton

                                          Jeremy Falcon wrote:

                                          Now I wish I had graph paper.

                                          Huh. All this technology, and I've never seen virtual graph paper. An ideal, simple, yet powerful application. Extensible. Hmmm.... Marc Pensieve Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson

                                          B Offline
                                          B Offline
                                          Bassam Abdul Baki
                                          wrote on last edited by
                                          #25

                                          Try this[^].


                                          "Religion is assurance in numbers." - Bassam Abdul-Baki Web - Blog - RSS - Math

                                          R 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups