Skip to main content

draw_chord()

Description#

Draws a chord within the boundaries of points x1,y1, and x2,y2 at the specified starting and ending angles.

Syntax#

draw_chord(x1, y1, x2, y2, start_ang, end_ang)
draw_chord(x1, y1, x2, y2, start_ang, end_ang,fill_in=True)

Parameters#

x1: x coordinate of top-left corner for the rectangle enclosing the chord
y1: y coordinate of top-left corner for the rectangle enclosing the chord
x2: x coordinate of bottom-right corner for the rectangle enclosing the chord
y2: y coordinate of bottom-right corner for the rectangle enclosing the chord
start_ang: starting angle
end_ang: ending angle
fill_in: Boolean that selects if the triangle will be filled in (white). Default to True.

Returns#

None

Example Code#
Python#
#Python code
from zumi.util.screen import Screen
screen=Screen()
screen.draw_chord(0,0,20,20,-180,0)
screen.draw_chord(30,30,50,50,-180,0)
#do a 360 from -180 degrees to 180 degrees
screen.draw_chord(60,30,100,50,-180,180)