I really need some help. I'm trying to write a computer program that when given a line segment (two points, xyz) and a sphere (a point and a distance R) will, assuming that the segment's end point and start point are outside the sphere, output a series of points that if were connected would reach the original line segment's end point without intersecting any part of the sphere.

But I have no idea where to begin at all! I should have listened more in college!

Someone, please help! :P

Edit: By the way, we're assuming the line intersects the sphere twice.