Intersection between a line and a sphere

前端 未结 8 2194
无人及你
无人及你 2021-02-09 05:51

I\'m trying to find the point of intersection between a sphere and a line but honestly, I don\'t have any idea of how to do so. Could anyone help me on this one ?

8条回答
  •  不知归路
    2021-02-09 06:40

    Or you can just find the formula of both:
    line: (x-x0)/a=(y-y0)/b=(z-z0)/c, which are symmetric equations of the line segment between the points you can find.
    sphere: (x-xc)^2+(y-yc)^2+(z-zc)^2 = R^2.

    Use the symmetric equation to find relationship between x and y, and x and z.

    Then plug in y and z in terms of x into the equation of the sphere.
    Then find x, and then you can find y and z.

    If x gives you an imaginary result, that means the line and the sphere doesn't intersect.

提交回复
热议问题