Thread: Dot Product.......Help

  1. #1
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    Dot Product.......Help

    What is the dot product exactly? I hear it's the angle that is created where two vectors meet.

    This book has this..........

    I am trying to find out if these two are two diferent formulas.


    where @="dot"
    where %=theta

    A @ B= Ax "time" Bx + Ay "times" By

    and

    A @ B= |A| @ |B| "times" COS %


    Thank you in advance
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  2. #2
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    I mean they are obviously two different formulas but if they do the same thing.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    yes
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  4. #4
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    What would be the value of theta? Also......so this is the angle that the vectors make they come together in the end point?
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  5. #5

  6. #6
    Banned
    Join Date
    Jan 2003
    Posts
    1,708
    it's the difference between the directions that two vectors point. If two vectors are exactly facing each other the dot product will be -1. If the dot product is 0 the vectors are perpendicular to each other. If the dot product is greater than 0 the two vectors cannot 'see' each other. Some uses for the dot product: lighting in OpenGL (that's why you need surface normals. If the dot product between the surface normal and the vector from the light to the polygon is negative then the polygon is facing the light and its color is calculated accordingly). Anoter use which is similar to the one I described is back face culling. Depending on what settings you have, and what order you draw the vertices, you will again have a surface normal which represents the 'front' of the polygon. If the dot product between the view vector and the surface normal is negative then it gets drawn, otherwise it is facing a completely different directly and does not get drawn.

    another equation, similar to yours

    cosTheta = A.B / ||A|| ||B||

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How Can I draw What I want?
    By CChakra in forum Game Programming
    Replies: 22
    Last Post: 09-11-2008, 08:38 AM
  2. need help making a dot bounce up and down y axis in this prog
    By redwing26 in forum Game Programming
    Replies: 10
    Last Post: 08-05-2006, 12:48 PM
  3. Simple program i cant get (dot moving)
    By Lupusk9 in forum C++ Programming
    Replies: 4
    Last Post: 09-14-2004, 08:04 PM
  4. Dot Product (includes attachment)
    By diamond in forum C Programming
    Replies: 23
    Last Post: 11-06-2003, 03:58 PM