line sphere intersection

paulweq123

New member
Joined
Mar 21, 2015
Messages
6
A line from P and touches the sphere in T , I want to find T.
I know P (x , y, z ) the center C ( 0,0,0) and ray R of the sphere.




my apologies im not sure if this is the place for this question.
Anyway thanks.

vvvvvvvvvvv.jpg
 
A line from P and touches the sphere in T , I want to find T.
I know P (x , y, z ) the center C ( 0,0,0) and ray R of the sphere.
View attachment 5138

The question actually makes no sense. The terms are all miss used.
I suspect that \(\displaystyle \overleftrightarrow {PT}\) is meant to be a tangent?
Do you mean that \(\displaystyle R\) is the radius of the sphere or \(\displaystyle \vec{OT}\) is a ray?
Which is it? Until you clear up to langue no one can help you.
 
Hello, paulweq123!

What is the original wording of the probem?


A line from P and touches the sphere in T. .I want to find T.
I know P(x,y,z), the center C (0,0,0) and radius R of the sphere.

From a point P, there are a brizillion possible tangents to a sphere.

Even In your 2D sketch, there are two possible tangents.
 
Sorry Soroban, I will put some information that omitted, your answer made ​​me think better!
the line PT touching the sphere in T , is a projection of a line passing by the vector v.
P+v, PT and PC they lie on the same plane.
Yes Pka, PT is tangent, Yes C(0,0,0) to T is a ray.
I'll try to do a better sketch!
Thanks for replies!

quest2.jpg
 
A line from P and touches the sphere in T , I want to find T.
I know P (x , y, z ) the center C ( 0,0,0) and ray R of the sphere.




my apologies im not sure if this is the place for this question.
Anyway thanks.

View attachment 5138
Unless I am misunderstanding the question, since (from a later post) line PC and PT lie in the same plane this problem is equivalent to the 'easier' problem:
Given a circle of radius R centered at (0,0) and a point P=(x0, y0) what is the point T=(x1, y1) such that the tangent line at T passes through P? We actually have just changed tangent plane to tangent line and ignored the fact that the plane may have been translated, stretched, and/or rotated about all three axes.

So we have
x2+y2=R2
and
y' = -x/y
Thus P lies on the line
y = y1 - (x1/y1) (x-x1)
and
y0 = y1 - (x1/y1) (x0-x1) = \(\displaystyle \frac{y_1^2 - x_1 (x_0-x_1)}{y_1}\)
and, since \(\displaystyle y_1=\pm\sqrt{R^2-x_1^2}\), we have
\(\displaystyle y_0\, \sqrt{R^2-x_1^2} = \pm[R^2 - x_1^2 - x_1 (x_0-x_1)]\, =\, \pm[R^2 - x_0\, x_1]\)
which will result in a quadratic equation for x1 and thus (generally) have two solutions.
 
Thanks Ishuda, but in 3D these formula give me the point T?
the problem was not picked up a book , actually I need to solve this for visibility 3D game.I'm not sure if knowing the radius help on something, however these are known items of problem.The main question is :
Discover the T point or plane that just touch the surface of sphere at the point T.
The vector v would not help ?
or maybe there is no solution or missing something..
 
Thanks Ishuda, but in 3D these formula give me the point T?
the problem was not picked up a book , actually I need to solve this for visibility 3D game.I'm not sure if knowing the radius help on something, however these are known items of problem.The main question is :
Discover the T point or plane that just touch the surface of sphere at the point T.
The vector v would not help ?
or maybe there is no solution or missing something..

Looks like a commercial problem - need to be solved for monetary profit.

You are located in Mumbai - why don't you hire a poor graduate student from nearby IIT for mutually beneficial trade??!!
 
I do not need the complete answer , only if it is possible or not, help a lot !


thanks!
 
Thanks Ishuda, but in 3D these formula give me the point T?
the problem was not picked up a book , actually I need to solve this for visibility 3D game.I'm not sure if knowing the radius help on something, however these are known items of problem.The main question is :
Discover the T point or plane that just touch the surface of sphere at the point T.
The vector v would not help ?
or maybe there is no solution or missing something..
The difference is only that the points don't all lie in a z=constant plane, the lines PC & PT lie in the plane
(x0y1-x1y0) z + (z0y1-z1y0) x + (z1x0-z0x1) y = 0,
the line PT also lies in the tangent plane
z = z1 + fx(x1,y1) (x-x1) + fy(x1,y1) (y-y1)
and the point (x1,y1,z1) is on the sphere
x2 + y2 + z2 = R2
and
z = f(x,y) = \(\displaystyle \sqrt{R^2 - x^2 - y^2}\)

BTW: I would check the equation for the first plane up there, I could have made a mistake.
 
Last edited by a moderator:
Unless I am misunderstanding the question, since (from a later post) line PC and PT lie in the same plane this problem is equivalent to the 'easier' problem:
Given a circle of radius R centered at (0,0) and a point P=(x0, y0) what is the point T=(x1, y1) such that the tangent line at T passes through P? We actually have just changed tangent plane to tangent line and ignored the fact that the plane may have been translated, stretched, and/or rotated about all three axes.

So we have
x2+y2=R2
and
y' = -x/y
Thus P lies on the line
y = y1 - (x1/y1) (x-x1)
and
y0 = y1 - (x1/y1) (x0-x1) = \(\displaystyle \frac{y_1^2 - x_1 (x_0-x_1)}{y_1}\)
and, since \(\displaystyle y_1=\pm\sqrt{R^2-x_1^2}\), we have
\(\displaystyle y_0\, \sqrt{R^2-x_1^2} = \pm[R^2 - x_1^2 - x_1 (x_0-x_1)]\, =\, \pm[R^2 - x_0\, x_1]\)
which will result in a quadratic equation for x1 and thus (generally) have two solutions.

The difference is only that the points don't all lie in a z=constant plane, the lines PC & PT lie in the plane
(x0y1-x1y0) z + (z0y1-z1y0) x + (z1x0-z0x1) y = 0,
the line PT also lies in the tangent plane
z = z1 + fx(x1,y1) (x-x1) + fy(x1,y1) (y-y1)
and the point (x1,y1,z1) is on the sphere
x2 + y2 + z2 = R2
and
z = f(x,y) = \(\displaystyle \sqrt{R^2 - x^2 - y^2}\)

BTW: I would check the equation for the first plane up there, I could have made a mistake.



thanks Ishuda!
So I can conclude that the ray R is essential for problem.There is no way to solve this problem inserting the vector v ?
For example, If I move the point P in some position around this sphere , the vector v(view direction) remaining always above the surface of the sphere , the point T must always be contained in the plane made by PC and the vector P+v .


That is, it is essential P+v lie on the same plane which PC and PT lie.

P is the position of airplane and v is a direction.

qqqqqqqqqqqqqqqqqqq.jpg
 
thanks Ishuda!
So I can conclude that the ray R is essential for problem.There is no way to solve this problem inserting the vector v ?
For example, If I move the point P in some position around this sphere , the vector v(view direction) remaining always above the surface of the sphere , the point T must always be contained in the plane made by PC and the vector P+v .


That is, it is essential P+v lie on the same plane which PC and PT lie.

P is the position of airplane and v is a direction.

View attachment 5142
If you know the vector v, then you can write a different equation for the first plane equation I wrote which point T must satisfy. That may make the solution easier to compute but I'm not sure of that.
 
I'm about finding a way to solve!
If I rotate the vector v around the normal N = (CP )x(v), for n degrees find a v1 vector, and scale by the distance equivalent to one of the catetos can find the point T.
The hardest part is to find the angle between v and v1!
vvvvvvvvvvv2.jpg
 
I'm about finding a way to solve!
If I rotate the vector v around the normal N = (CP )x(v), for n degrees find a v1 vector, and scale by the distance equivalent to one of the catetos can find the point T.
The hardest part is to find the angle between v and v1!
View attachment 5148
\(\displaystyle \mathbf v \cdot \mathbf w = \left\Vert{\mathbf v}\right\Vert \left\Vert{\mathbf w}\right \Vert \cos \theta\)
 
Top