fossunited / joy

Joy is a tiny creative coding library in Python.
MIT License
193 stars 19 forks source link

Add Ellipse Shape #3

Closed anandology closed 3 years ago

anandology commented 3 years ago

The API

I think it is better to specify width and height of the ellipse, just like the rectangle. Using rx an ry as in SVG doesn't look that elegant.

e = Ellipse()
e = Ellipse(width=100, height=200)
e = Ellipse(center=Point(10, 20), width=100, height=200)

Going by the same argument, we should be using the diameter for the circle, not radius. @amitkaps what do you think?

Reference

https://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse

amitkaps commented 3 years ago

From a compass analogy, radius is easier to understand. From alignment with Ellipse syntax, width = height = diameter is better.

Either is fine. You should pick based on how you want teach it for the moment and your objectives on syntactic simplicity.