unfortunately my math skill is a bit lacking
I need to find the latitude and longitude of the intersection of a ray coming from the center of a sphere to the radius/surface.
What I have right now is lat=atan(z,x) and lon=asin(y) (after normalization)
Now this doesn't provide a very convincing sky-sphere, since usually you aren't in the core of the earth. What I want to do is move the origin of the ray upward closer to the surface. I guess this only changes the longitude, and it can be computed with a table.
I just need a formula to convert angle a to b, http://imageshack.us.../problem1a.png/
edit: and what is known is 'a' (or the actual ray), the radius of the sphere, and Y or height of the ray from the center of the circle
simple math problem
Intersect the ray with the sphere, then use the formulas you already have to compute latitude and longitude.
Hi Bimm,
You can determine 'b' using the law of sines. From your figure this can be expressed as,
R * sin( c) = Y * sin(pi/2 + a)
where 'c' is the angle opposite the side of length, Y. Rearranging the above expression gives,
c = asin(Y * sin(pi/2 + a) / R).
Since the internal angles of a triangle add up to pi (or 180 degrees if you prefer), we can determine b
b = a - pi/2 + asin(Y * sin(pi/2 + a) / R)
-Josh
You can determine 'b' using the law of sines. From your figure this can be expressed as,
R * sin( c) = Y * sin(pi/2 + a)
where 'c' is the angle opposite the side of length, Y. Rearranging the above expression gives,
c = asin(Y * sin(pi/2 + a) / R).
Since the internal angles of a triangle add up to pi (or 180 degrees if you prefer), we can determine b
b = a - pi/2 + asin(Y * sin(pi/2 + a) / R)
-Josh
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement