1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Ray-Sphere Intersection

  1. Aug 3, 2008 #1
    I'm trying to work through an explanation of how a ray-sphere intersection can be solved algebraically from here:
    http://wiki.cgsociety.org/index.php/Ray_Sphere_Intersection

    My problem is at this step:

    I don't understand how they've expanded the formula.

    I thought you just multiplied each term in the left bracket by each term in the right bracket...which gave me...

    (o.o) + (c.c) - 2(c.o) - 2(d.c) + 2t(d.o) + t^2 (d.d) = r^2


    Have I made a mistake or is there some trick I'm missing?
     
  2. jcsd
  3. Aug 3, 2008 #2
    You're expanding it out too far. The idea is to get it in a quadratic form. You treated it as three terms being squared and they treated it as two terms. Treat (o-c) as one term in the initial brackets and td as the other term. Then expand keeping (o-c) together as one term.
     
  4. Aug 3, 2008 #3

    Defennder

    User Avatar
    Homework Helper

    There isn't any trick. Just apply the distributive and commutative property of dot product to the vectors.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Ray-Sphere Intersection
Loading...