4 ms·
> The "ellipse" function should only take 2 arguments - a point and a size (or 2 points if that's your thing). How do you handle ellipses with different eccent
by KMag 6y ago
> The "ellipse" function should only take 2 arguments - a point and a size (or 2 points if that's your thing).
How do you handle ellipses with different eccentricities?
There are several equivalent representations of ellipses, one of which is the two foci and the sum of the distances from the edge to the two foci... so two points and a distance (or you could use two points and the major axis, etc., etc.) A pair of points don't uniquely define one ellipse. Likewise, a center and a "size" doesn't uniquely define an ellipse.
- drdeca 6y agoI think maybe they meant for an ellipse drawing function which, like the one depicted in the webpage, only allows ellipses with both axis either horizontal or vertical, and was suggesting that the "size" argument would have 2 numbers to it.
- thewebcount 6y agoYes, that's what I meant. Obviously there are other ways to represent other types of ellipses, but given the constraints of the example in the article, I thought that was clear.
- Izkata 6y ago> A pair of points don't uniquely define one ellipse. What if the two points were the corners of an enclosing rectangle? This is how, for example, Gimp does the ellipse selector tool.
- KMag 6y agoThere are multiple ellipses bounded by that rectangle, unless you limit yourself to ellipses with major axis either vertical or horizontal.