Like JS CanvasRenderingContext2D.arc().
One simple way
This V2 handles anti-clockwise better but probably still needs start/end if specified as negative values
The lines drawn by that are a little too thick for my purposes:
I would prefer them be 0-1 pixels thick, but they're 1-2 pixels thick with a pen size of 1.
Edit: This is what I'd prefer for radius 9:
Method 1:y=sqrt(r^2-x^2) then swap x and y
Method 2:y=sin(t)*r,x=cos(t)*r
Method ???:e^(pi*sqrt(-1)*t) (note:have bignums on)
turn on flat line ends and decrease the pen size (yes, lower than 1 works just fine)
also personally i would use this block, it should run a lot faster with no noticeable difference
the direction part isn't needed because it always just goes from start to end in the direction that implies
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.