chalk-diagrams / chalk

A declarative drawing API in Python
MIT License
282 stars 13 forks source link

Arc Argument order #98

Open srush opened 2 years ago

srush commented 2 years ago

I don't know how important this is, but should the arc function use the same direction (either clockwise or counterclockwise) irrespective of its arguments? For example,

dia = cat(
    [
        arc(1, 0, 90).show_origin(),
        arc(1, 90, 0).show_origin(),
        arc(1, 90, 360).show_origin(),
    ],
    unit_x,
    sep=0.5
)

produces test_arc but maybe the second arc should be the same as the third one?

_Originally posted by @danoneata in https://github.com/danoneata/chalk/pull/96#discussion_r942250001_

danoneata commented 2 years ago

I was thinking about this; maybe a clearer alternative would be for arc to just mirror ArcSegment's constructor? That is, specify an arc by its radius, starting angle and a difference (delta) angle (instead of the ending angle).