XML technologies / SVG / Creating simple SVG graphics / SVG tag syntax / The ellipse tag

(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)

The tag <ellipse> creates an ellipse rather than a circle, but can also create circles. For example, WebDraw uses the <ellipse> tag by default when drawing a circle. Besides the universal attributes id and style, the tag has the attributes cx, cy, rx and ry.

The attributes cx and cy specify the center, as for a circle. Since an ellipse can be taller than it is wide, it needs two different radius values, provided by the attributes rx and ry. The following figure illustrates the attributes’ meaning.

Meaning of the attributes defining the ellipse’s shape

Figure: Meaning of the attributes defining the ellipse’s shape.

Note:
You can only create horizontal or vertical ellipses this way, not tilted ones. However, SVG provides the attribute transform to rotate elements.

   

 

 

 

back to top