wand's draw.arc takes three arguments:
What is the underlying math being used here? Unfortunately, only one example is given:
from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color
with Drawing() as draw:
draw.stroke_color = Color('blue')
draw.stroke_width = 2
draw.fill_color = Color('white')
draw.arc(( 25, 25), # Stating point
( 75, 75), # Ending point
(135,-45)) # From bottom left around to top right
with Image(width=100,
height=100,
background=Color('lightblue')) as img:
draw.draw(img)
img.save(filename='draw-arc.gif')
I've marked 25,25 and 75,75 in this image:
I'm mystified on how 135 and -45 relate to those two points? I understand the first two (x,y) arguments but the start/end tuple confuses me.
Check out ImageMagick's Primitive Draw Commands usage guide. The start & end points define the rectangle where the arc will be drawn.
The 'arc' draw primitive is listed with rectangles as it is really just a 'ellipse' that is fitted inside the 'rectangle' defined by the two coordinates. Partial arcs are rarely used as it can be hard to determine the end points unless the angles are limited to multiplies of ninety degrees.
It may be worth looking into path_*
methods, as Drawing.path_elliptic_arc()
might behave closer to what you would expect.
Edit
I'm mystified on how 135 and -45 relate to those two points?
The last tuple defines which part of the ellipse to draw. We express this by start angle, and end angle relative 0° facing east.