def curve(t, radiusX, radiusY):
x = sin(t*pi/2) * radiusX
y = cos(t*pi/2) * radiusY
return (x,y)
Following Python pseudo-code will draw a part 1/4 of an ellipse.
However, I am looking to stop drawing at given Y, as I don't need full 1/4 of this ellipse.
Can this function be parametrized such that it will stop drawing at given Y, without affecting the curve < Y?
An alternative approach is to draw using the current function and then cut the resulting object to given max height from the bottom, which I am trying to simplify.
I think the direction of the solution is to keep y at constant step using y = t * radiusY while x should be a transformed formula that will tell us what's the proper x given our y?
y = t * heightx = radiusX/radiusY*sqrt(radiusY*radiusY-y*y)a proper formula? it seems to bug out at lower height (at least) – underflow Dec 15 '23 at 20:09