RE: [Algorithms] Nearest point on plane for 2D IK
Brought to you by:
vexxed72
From: Robert D. <RD...@ac...> - 2000-08-29 20:10:14
|
> Hi, > > I am looking for an algorithm to compute the intersecting > point P between a ray and > a sphere. I know the center C and the radius R of the sphere, > the origin O of the ray > and its direction V. Basically I need to find the closest > intersection from O. > > But that's not all: In addition to this, IF the ray does not > intersect or is tangent to the > sphere, I need to know the tangential point with the sphere. > > Does anybody know a fast and accurate solution to this > problem? maybe a good web > site or some code would greatly help!... Hmmm ... surely what you want is to find the point on the line closest to the center of the sphere (easy to do) and then if that is less than R away from the center you have definite intersection, and proceed to compute the points at which the line intersects the sphere, and otherwise, you conveniently have a point which is in line with the nearest tangential point of the sphere, so you can easily find that tangential point. Rob |