Find Distance to Curve for Arbitrary Point - Nille

  • Context: Graduate 
  • Thread starter Thread starter LostInSpace
  • Start date Start date
  • Tags Tags
    Curve
Click For Summary
SUMMARY

The discussion centers on finding the distance from an arbitrary point \(\vec{r}\) to a Bezier curve defined by the parametric equations \(\vec{b}(t) = (x(t), y(t))\) where \(x(t)\) and \(y(t)\) are cubic polynomial functions of \(t\). The user, Nille, seeks to identify points \(\vec{b}(t_0)\) on the curve such that the normal at these points intersects with \(\vec{r}\). It is clarified that the gradient \(\nabla \vec{b}(t)\) represents the tangent vector, not the normal, and the condition for intersection is established through the dot product equation \((\vec{b}(t_0)-\vec{r})\cdot\frac{d \vec{b}}{dt}(t_0)=0\).

PREREQUISITES
  • Understanding of Bezier curves and their parametric representation.
  • Familiarity with calculus concepts, particularly derivatives and gradients.
  • Knowledge of vector operations, including dot products.
  • Basic programming skills for implementing mathematical algorithms.
NEXT STEPS
  • Study the mathematical properties of Bezier curves, focusing on cubic Bezier curves.
  • Learn about vector calculus, specifically how to compute gradients and normals.
  • Explore algorithms for finding intersections between curves and points in computational geometry.
  • Implement a solution in a programming language, such as Python, using libraries like NumPy for vector operations.
USEFUL FOR

Mathematicians, computer graphics developers, and anyone involved in geometric modeling or computational geometry who needs to calculate distances to curves.

LostInSpace
Messages
21
Reaction score
0
Hi!

I have a bezier curve defined by:
[tex] \vec{b}(t) = (x(t), y(t))[/tex]
where
[tex] \begin{array}{lcl}<br /> x(t) &=& a_xt^3 + b_xt^2 + c_xt + x_0 \\<br /> y(t) &=& a_yt^3 + b_yt^2 + c_yt + y_0<br /> \end{array}[/tex]
for [tex]t \in \lbrack 0, 1 \rbrack[/tex]. All constants are computed from vertices on the curve and control points associated with those vertices.

For an arbitrary point [tex]\vec{r}\in\mathbb{R}^2[/tex] I want to find all points [tex]\vec{b}_{t_0}\in\vec{b}(t)[/tex] (if any) that satisfies
[tex]\vec{b}_{t_0} + \nabla\vec{b}(t_0)s = \vec{r}[/tex]
for some [tex]s[/tex].

Not sure I'm correct here, but as fas as I remember, [tex]\nabla \vec{b}(t)[/tex] is the normal to the curve, right?

I don't know how to explain this in a better way...
For any point [tex]\vec{r}[/tex] I want to find all points [tex]\vec{b}(t_0)[/tex] such that the normal to [tex]\vec{b}(t_0)[/tex] intersects [tex]\vec{r}[/tex].

How can I do this?

Thanks in advance,
Nille
 
Physics news on Phys.org
LostInSpace said:
Not sure I'm correct here, but as fas as I remember, [tex]\nabla \vec{b}(t)[/tex] is the normal to the curve, right?
No, [tex]\nabla \vec{b}(t)[/tex] (or rather [tex]\frac{d \vec{b}}{dt}(t)[/tex]) is the tangent vector to the curve. I suppose you're looking for all [tex]t_0[/tex] for which the vector [tex]\vec{b}(t_0)-\vec{r}[/tex] is perpendicular to the tangent vector. This just means that there dotproduct is zero:

[tex](\vec{b}(t_0)-\vec{r})\cdot\frac{d \vec{b}}{dt}(t_0)=0[/tex]
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
7K
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K