I am coding the intersection of a 3D Bézier curve with parametric equation and a parametric sphere equation, with the objective of splitting the Bézier curve at that specific point. Can you check my equations?

I define my sphere and Bézier as: $$\begin{array}{l}{X_s} = r*\cos (v)\cos (u)\\{Y_s} = r*\cos (v)\sin (u)\\{Z_s} = r*\sin (v)\\B(t) = {(1 - t)^3}{P_{01}} + 3(t - 2{t^2} - {t^3}){P_{11}} + 3({t^2} - {t^3}){P_{21}} + {t^3}{P_{31}}\end{array} $$

Under this equations my intersection is defined as:

$$\begin{array}{l}r*\cos (v)\cos (u) = {(1 - t)^3}{P_{01X}} + 3(t - 2{t^2} - {t^3}){P_{11X}} + 3({t^2} - {t^3}){P_{21X}} + {t^3}{P_{31X}}\\r*\cos (v)\sin (u) = {(1 - t)^3}{P_{01Y}} + 3(t - 2{t^2} - {t^3}){P_{11Y}} + 3({t^2} - {t^3}){P_{21Y}} + {t^3}{P_{31Y}}\\r*\sin (v) = {(1 - t)^3}{P_{01Z}} + 3(t - 2{t^2} - {t^3}){P_{11Z}} + 3({t^2} - {t^3}){P_{21Z}} + {t^3}{P_{31Z}}\end{array} $$

This gives me a system of three unknown $u,v,t$ and three equations. Am I correct? Is there a better way?


1 Answer 1


You equations are correct, but there is a better way. You should use the implicit equation of the sphere. This is $x^2 + y^2 +z^2 =r^2$, which can also be written as $\| \mathbf X \|^2 = r^2$ or $\mathbf X \cdot \mathbf X = r^2$.

Solve the equation $\mathbf{B}(t) \cdot \mathbf{B}(t) = r^2$. Here the dot denotes a vector dot product.

This is a single polynomial equation of degree 6 in the variable $t$. You will still have to solve it using numerical methods, but this is much easier than solving a system of three equations in three unknowns.

  • $\begingroup$ Thank you for the answer and the edit,sorry for the errors. I was in a hurry for organizing other equations. $\endgroup$ Oct 21, 2016 at 0:49
  • $\begingroup$ Why is this an equation of degree 6? It seems cosine must be equal to 1, isn't it? Then, $\mathbf{B}(t) = r$. Or where do I mistake? $\endgroup$ Sep 15, 2021 at 8:57
  • 1
    $\begingroup$ The dot represents the dot product of two vectors. Your equation $\mathbf{B}(t) = r$ doesn’t make sense because the left side is a vector and the right side is a scalar. $\endgroup$
    – bubba
    Sep 15, 2021 at 10:39
  • $\begingroup$ I don’t know what cosine you’re talking about. $\endgroup$
    – bubba
    Sep 15, 2021 at 10:41
  • 1
    $\begingroup$ You can use the equation $\| \mathbf B (t) \| = r$, if you want, but that will still have degree 6 after you remove the square root. $\endgroup$
    – bubba
    Sep 15, 2021 at 10:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .