I'm trying my best to figure a circle problem out!
Consider a circle, or an ellipse (a circle scaled either on the local X or Y axis). For any two points in quadrant 1, what is the equation of the circle/ellipse such that it passes through both points, having those points rest on quadrant 1 of the circle/ellipse if it was a unit circle, or in other words, have it rest on the arc from $0$ to $\pi/2$. I figure there's likely an infinite number of solutions depending on the scale, and that's desired, because I'm looking to have input parameters: point1X, point1Y, point2X, point2Y, circleScaleX, circleScaleY
. It's possible that there's still more than one solution with those inputs, and if so, what else do I have to constrain?
The point of what I'm trying to accomplish isn't really to get one solution anyway, but to get a variable shape arc between the two points, being able to tweak it until it looks good. So even if there's a third circle variable of some kind to set to result in the one solution I need to paint the arc to the screen, that's cool with me.
Now that I think about it, I think a constraint for the points is that point1X < point2X
and point1Y > point2Y
so that we always result in the arc "roundness" pointing out in the positive direction of $y = x$.
I should note that it's a requirement that the arc is composed of a segment of a circle or ellipse, I can't use something like Bézier curves.
Thanks ahead of time, all the best!
circleScaleX
andcircleScaleY
correspond to the semiaxes or not. Another way to put that is "If the ellipse you search has axis-aligned bounding box with width `2circleScaleXand height
2circleScaleY`, then there is a solution; otherwise, we do not have enough information, and have infinitely many possible solutions, and no way to choose". – Blabbo the Verbose Jun 29 '21 at 19:36circleScaleX
andcircleScaleY
you might havepoint1X < point2X
andpoint1Y > point2Y
and yet the two points might still not be on the arc from $0$ to $\frac\pi2.$ An alternative set of input would be the coordinates of both points, wherepoint1X < point2X
andpoint1Y > point2Y
, and two angle values, $0 \leq \theta_2 < \theta_1 \leq \frac\pi2$, where $\theta_1$ and $\theta_2$ are the values you plug into the parametric formula of the ellipse. This guarantees both points are first quadrant. – David K Jun 30 '21 at 11:39