Polygons

Learn how to make complex polygons with Pycairo.

We'll cover the following

In this lesson, we will look at a slightly more complex polygon: a useful arrow shape. This example will illustrate a few techniques that can be used to design polygons.

A simple arrow

Here, we will see how to draw an arrow, as shown in the picture below. We need the following parameters to make an arrow: position of the shape on the canvas (x and y coordinates), size of the shape (height and width), length of the tail (a), and inset (b). Here is a pictorial representation of these parameters:

Get hands-on with 1400+ tech skills courses.