Open In App

Wand path_elliptic_arc() function in Python

Last Updated : 16 Oct, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

path_elliptic_arc() is a function specially introduced for paths. path_elliptic_arc() draws an elliptical arc from current point to a particular point we want the arc to drawn to. 
Let's see parameters needed for this function.
 

Syntax : 
 

wand.drawing.path_elliptic_arc(to, radius, rotation, large_arc, clockwise, relative)


Parameters:
 

ParameterInput TypeDescription
tosequence or (numbers.Real, numbers.Real)pair which represents coordinates to draw to.
radiuscollections.abc.sequence or (numbers.Real, numbers.Real)pair which represents the radii of the ellipse to draw.
rotatebooldegree to rotate ellipse on x-axis.
large_arcbooldraw largest available arc.
clockwisebooldraw arc path clockwise from start to target.
relativebooltreat given coordinates as relative to current point.


 


Example : Draw an elliptical curve. 
 

Python3
from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color

with Drawing() as draw:
    draw.stroke_width = 2
    draw.stroke_color = Color('black')
    draw.fill_color = Color('white')
    draw.path_start()
    # Start middle-left
    draw.path_move(to =(10, 100))
    # draw elliptical curve
    draw.path_elliptic_arc(to =(10, 180),
                           radius = (20, 40),
                           rotation = 270,
                           large_arc = True,
                           clockwise = True,
                           relative = True )
    with Image(width = 200, height = 200, background = Color('lightgreen')) as image:
        draw(image)
        image.save(filename ="pathcurve.png")

Output : 
 


 


Article Tags :

Explore