Arcs #2

Example 1 Example 1.1 Example 2 Example 3 30° CW Example 4 30° CCW

Recall the order of parameters used with the a command:

Example 1 shows 4 arcs of ellipses made with the following code:

<path d="M125,75 A100,50 0 0 0 225,125" fill="none" stroke="red" stroke-width="2"/>
<path d="M125,75 A100,50 0 0 1 225,125" fill="none" stroke="blue" stroke-width="2"/>
<path d="M125,75 A100,50 0 1 0 225,125" fill="none" stroke="orange" stroke-width="2"/>
<path d="M125,75 A100,50 0 1 1 225,125" fill="none" stroke="green" stroke-width="2"/>

To create a complete horizontal ellipse instead of just an arc, we use a Z or z command to close the figure.

See Example 1.1.

<path d="M290,200 a50,100 90 1, 1 0 1 Z" fill="none" stroke="blue" stroke-width="2"/>

These ellipses are horizontally aligned, but we can alter that by changing the x-axis rotation. Here we have a vertical ellipse by making the x-axis rotation 0°, as in Example 2.

<path d="M50,450 a50,100 0 1, 1 10 1 Z" fill="none" stroke="black" stroke-width="2"/>

By altering the x-axis rotation, we can tip the ellipse any way we want. Example 3 and Example 4 show how this is done.

<path d="M170,450 a50,100 30 1, 1 10 1 Z" fill="none" stroke="brown" stroke-width="2"/>

<path d="M450,450 a50,100 -30 1, 1 10 1 Z" fill="none" stroke="blue" stroke-width="2"/>

Note that all of these examples EXCEPT Example 1 use the a command for relative coordinates, not the A command for absolute coordinates.