Intersection of tangent Plane of a sphere and a line in 3D vector space.

644 Views Asked by At

Given a sphere equation: x^2+y^2+z^2=r^2 ,calculate the point of intersection of a line with point Q(x1,y1,z1) and direction vector D(l,m,n)and line meeting Q and P without intersecting the sphere in between, given a point P(x2,y2,z2) which is on opposite side of the sphere. So, basically, I need to find the point of intersection of line QD and line QP but without touching the sphere in between.

EDIT: First of all sorry for poorly citing this question.

So, I know there is no unique tangent line from an extrenal point to a sphere. Basically, what this question asked was there were two points and a sphere in a 3D space and both were at opposite sides of the sphere. Our goal is to find when will the line connecting both points will not intersect the sphere if P is static and Q is moving. So, What I did so far was, I knew the direction vector of the point Q, that D(l,m,n) and I calculated the Line QD. What I need to know now is The line touching the sphere and passing through P, will meet QD. So basically the point of intersection of a tangent line of the sphere passing through P, and the line QD. Q is moving with a constant velocity(not given) and only the direction vector is given. And we have to find the time 't' at which the line segment QD won't intersect the sphere: Direction vector tells the position of Q as: Q(t)=Q(0)+D.t[Q(0) is the intial position(x1,y1,z1) and D is(l,m,n)]

What I thought to do:

I made the equation of QD:

$(x-x1)/l$ = $(y-y1)/m$ = $(z-z1)/n$=k

Which gives me parametric value of point of intersection to be: x'=kl+x1,y'=mk+y1 and z'=nk+z1

Let this point be O(x',y',z') Then I made the equation of line OD such that it touches the sphere,which would be:

$ (x-x2)/x2-x' =(y-y2)/y2-y' =(z-z2)/z2-z' $

Now I know this line will contain a point M such that it touches the sphere: $x^2+y^2+z^2=r^2$ , but now comes my main problem: this equation OD, should I put this equal to 1? or another variable k', which will give me a point M:$ x''=(x2-x')k'+x2, y''=(y2-y')k'+y2, and z''=(z'-z2)k' +z2 $ , which I have to put in the equation of the sphere and make a quadratic equation. But then I would have two variables, k, and k', which is my main concern, like, can I put k'=1 ??, I know that I have to make an equation of the line OD and put in the circle which will give me a quadratic equation in which I will put $b^2-4ac=0$ which will be the condition of tangency. But still, My main worry is two variable.

I believe I am making a silly mistake, so please guide me in the right direction. Thank you.