Answer the question
In order to leave comments, you need to log in
How to find equidistant points on a bezier curve or ellipse?
There was a need for a subject, I fight the second day, I can’t even sleep.
Guys, I honestly searched the Internet, I will not argue that I found some solutions ( stackoverflow.com/questions/10477/equidistant-poin... , mathoverflow.net/questions/28070/finding-n-points-... but with my preschool knowledge about geometry, the effectiveness of these answers is reduced to zero, and allows only these objects to be displayed on the screen
Yes, I know you need to know geometry if you ask such questions, but now I don’t have too much time for this, but I will definitely devote to this PS
I am writing a javascript script, honestly - you need to place pictures on an ellipse equidistantly, but if it is too resource-intensive, curves will do.
PPS If anyone needs to visualize the essence of the problem and what I can't do - www.saccade.com/writing/graphics/RE-PARAM.PDF on the second page is a visual demonstration (but not on an ellipse or curve).
Answer the question
In order to leave comments, you need to log in
The correct answer was found on stackoverflow
In fact, the local author used a variant with the parametric equation of the ellipse:
But each step of the alpha parameter is not a constant, but is determined by the formula:
To calculate the length of the ellipse L, you can use the Ramanujan formula:
What does "equidistant" mean? Equal Cartesian distance between points or equal arc length of the curve?
For an ellipse, the problem cannot be solved analytically, since the solution contains an elliptic integral, which is not taken in a general form.
It is possible to convert an ellipse into a set of Bresenham points , keeping, in addition to coordinates, the distance to the previous point (shift only in X or Y gives 1, simultaneous shift gives sqrt(2)) and sum the distances to get the length of the approximate line. Then we divide this length into the required number of parts, getting a step along the arc and sum up the distances from the starting point until the desired step is obtained.
With an ellipse it seems quite simple - arrange on a circle, then flatten.
Flattening can be easily done like this
X_ellipse=X_env
Y_ellipse=Y_env*a/
b
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question