wxPython / demo / snippets / arc.py

xc = 0.5
yc = 0.5
radius = 0.4
angle1 = 45.0  * (M_PI/180.0)  #/* angles are specified */
angle2 = 180.0 * (M_PI/180.0)  #/* in radians           */

snippet_normalize (cr, width, height)

cr.arc (xc, yc, radius, angle1, angle2)
cr.stroke ()

#/* draw helping lines */
cr.set_source_rgba (1,0.2,0.2,0.6)
cr.arc (xc, yc, 0.05, 0, 2*M_PI)
cr.fill ()
cr.set_line_width (0.03)
cr.arc (xc, yc, radius, angle1, angle1)
cr.line_to (xc, yc)
cr.arc (xc, yc, radius, angle2, angle2)
cr.line_to (xc, yc)
cr.stroke ()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.