Answer the question
In order to leave comments, you need to log in
Which curve is more efficient to build on the set [0; 1] - Bezier, non-integer power or hyperbola?
Good afternoon!
I am looking for the most efficient algorithm for the approximate calculation of a parametrized curve on the set [0; 1], marked in orange in the figure: It is
important to be able to change the curvature, getting a very large and very small derivative at the ends, or simply have a linear increment.
They come to mind
- exponentiation with an exponent that changes approximately within the boundaries of [0,1; 10]
- bezier curve
- scaled and shifted hyperbola
Perhaps there are alternatives, but I did not find them.
Which of the algorithms for calculating these curves is more efficient?
The curve is calculated once per second, each curve has approximately 50,000 points.
Answer the question
In order to leave comments, you need to log in
Here, as a native, falls Rational Bézier curve of the second order
Basis
b0(t) = (1-t)^2
b1(t) = 2*(1-t)
b2(t) = t^2
Points
P0 = (0, 0)
P1 = (1, 0) (or 0.1)
P2 = (1, 1)
Then the usual curve is: B(t) = sum_by_i(b(i) *P(i))
Rational B(t) = sum_by_i (b(i) * P(i) * w(i) ) / sum_by_i(b(i, w(i))
Where w(i) is the weight of the vertices by setting w(1) > 1 you get your
result the curve tends to approach the vertex with weight > 1 and vice versa
x(t) = t * log(a*t)
y(t) = t * log(b*t)
t changes [0;1].
Depending on a and b, you get the desired kind of curve. In a particular case a=b.
Subjectively, the hyperbola looks the most effective, especially since the position of the change in the second coordinate is calculated analytically, which allows you to draw "tails" very quickly.
How seriously are you ready to be puzzled by acceleration?
If it is necessary that the curve can be drawn through any point of the square, then the hyperbola is perhaps better. The equation looks attractive: (a^2-1)*x*y+(xa^2*y)=0, finding the value of a for any point through which the curve passes is not difficult. It is a little more difficult to draw it so that the points are located with the desired density.
I thought about something like y^a+(1-x)^a=1, but it is unlikely to fit, although it is symmetrical: the families of curves for a<1 and a>1 are not symmetrical to each other.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question