Polygon
To create a polygon, use the polygon
tag. The best way to think about an SVG polygon is to compare it to a child's dot-to-dot game. You can imagine a series of dots and a pen connecting each (x,y) coordinate with a straight line. The series of dots is identified in the points
attribute. Take the following as an example (http://localhost:8080/chapter-2/polygon.html
):
<polygon points="60,5 10,120 115,120"/>
First, we start at 60,5
and we move to 10,120
. Then, we proceed to 115,120
and finally return to 60,5
(note that the pen returns to the starting position automatically.)