Results 1 to 7 of 7

Math Help - Point to Sphere calculation

  1. #1
    Newbie
    Joined
    Oct 2010
    Posts
    4

    Point to Sphere calculation

    Ok I am not exactly sure what subject this goes under as I can't find a good way of calculating it in my calc book and racked my brain for other methods, but I am stumped. Ok basically here is the problem.
    I know my position in space, any coordinate system will do. I am inside of a sphere that has radius r. Knowing my position and a vector pointing at a known angle, I need to figure out where the vector and the sphere intersect.

    That seems a little convoluted, so I will try to explain the practical application.
    I know my position on earth (latitude, longitude, altitude).
    I know exactly where the sun is with respect to me (Zenith angle, Azimuth angle)
    If I look directly at the sun (DO NOT ATTEMPT), where does the vector I am looking at intersect with a sphere that has a radius of 1000 meters greater than my current altitude.
    Keep in mind that the earth curves, so a simple trig calculation doesn't do the trick.

    It seems so simple, but I just can not figure out how to solve it.
    If anyone could point me toward a theorem or technique or law I would appreciate it.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    Let the center of the sphere of radius r be the origin O. Let the current position of the observer be at a known vector \mathbf{P} with respect to the origin. Let the known vector pointing to some object (such as the sun) from the observer be denoted \mathbf{Q}. Let the smaller angle between \mathbf{P} and \mathbf{Q} be denoted \varphi. This angle is known. Let the vector from the origin to the intersection of the sphere and \mathbf{Q} be denoted \mathbf{R}. Finally, let the vector \mathbf{q}:=\mathbf{R}-\mathbf{P}.

    We know that |\mathbf{R}|=r. We also know that \mathbf{P}+\mathbf{q}=\mathbf{R}. Hence,

    |\mathbf{R}|^{2}=\mathbf{R}\cdot\mathbf{R}=(\mathb  f{P}+\mathbf{q})\cdot(\mathbf{P}+\mathbf{q})=P^{2}  +q^{2}-2Pq\cos(\varphi)=r^{2}.

    Rearranging, we obtain

    q^{2}-2qP\cos(\varphi)+P^{2}-r^{2}=0.

    Viewing this is a quadratic in q, we find the two solutions

    q=P\cos(\varphi)\pm\sqrt{r^{2}-P^{2}+P^{2}\cos^{2}(\varphi)}.

    Because r>P, we may throw out the negative square root solution, since q>0. Hence,

    q=P\cos(\varphi)+\sqrt{r^{2}-P^{2}\sin^{2}(\varphi)}.

    Now, the direction of \mathbf{Q} is the same as the direction of \mathbf{q}. Hence, we can write

    \mathbf{q}=q\,\dfrac{\mathbf{Q}}{Q}=\left(P\cos(\v  arphi)+\sqrt{r^{2}-P^{2}\sin^{2}(\varphi)}\right)\dfrac{\mathbf{Q}}{Q  }.

    Finally, we write

    \mathbf{R}=\mathbf{P}+\left(P\cos(\varphi)+\sqrt{r  ^{2}-P^{2}\sin^{2}(\varphi)}\right)\dfrac{\mathbf{Q}}{Q  }.

    This is the desired vector in terms of known quantities, and is thus a solution to your problem.

    Make sense?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Oct 2010
    Posts
    4
    Well it makes sense, and thanks for the reply, but I was aware of this solution and there is one problem. I do not know the angle gamma.
    I believe in this setup q is the vector between point p and the intersection of q and the sphere. If my understanding is correct.
    So in the terms that you have set up. I am aware of.
    The radius of the sphere
    vector p
    The angle between vector p and and the vector pointing at the intersection on the sphere.
    That is where my problem comes in.
    I have attached a crude drawing of my problem. please note that the I merely extended the line from point P for clarity showing that it is in fact the angle between point P and the sun. The actual vector ends at the intersection of the sphere.
    Point to Sphere calculation-math-question.png
    Follow Math Help Forum on Facebook and Google+

  4. #4
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    The angle phi, written \varphi and pronounced /FEE/, is the angle between vector \mathbf{P} and \mathbf{Q}. That is precisely the angle that I'm using here, and that, in your drawing, you mark as "known". Are you saying that you don't know the direction of \mathbf{Q}? If so, I'd say your problem is unsolvable.

    Here is my drawing of the problem. The capital letters are all vectors, and \phi=\varphi.

    Point to Sphere calculation-point-sphere-problem.jpg

    What exactly in this formula don't you know:

    \displaystyle\mathbf{R}=\mathbf{P}+\left(P\cos(\va  rphi)+\sqrt{r^{2}-P^{2}\sin^{2}(\varphi)}\right)\dfrac{\mathbf{Q}}{Q  }.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Oct 2010
    Posts
    4
    I am not sure, I actually realized that I can solve everything simple enough using the law of sins. It has been so long, I forgot about them. Anyway, thanks for the help.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Oct 2010
    Posts
    4
    No looking back on your explanation, you were correct, I misunderstood your relationship between Q and R. I thought you were saying they were the same thing, but now that I look at it, I could use that method as well.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    5
    Awards
    2
    You can use the law of sines, sure. It might be a little trickier to get a vector representation of everything, but I suppose it depends to some extent on exactly what information you need. Do you need a full vector representation? Or do you just want angles?
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: September 16th 2011, 05:05 AM
  2. maximum distance from point to sphere
    Posted in the Advanced Algebra Forum
    Replies: 7
    Last Post: January 31st 2011, 05:25 PM
  3. Replies: 4
    Last Post: September 8th 2010, 10:13 AM
  4. Replies: 9
    Last Post: July 20th 2010, 09:00 AM
  5. Normal vector at a point on a sphere/ellipsoid
    Posted in the Calculus Forum
    Replies: 5
    Last Post: September 2nd 2006, 04:34 AM

Search Tags


/mathhelpforum @mathhelpforum