<circle cx="200" cy="200" r="100" />Similarly, The <ellipse> element has attributes; cx, cy, rx, and ry where the center of the ellipse is defined to be at point (cx,cy), has a x-radius defined by the rx attribute, and has a y-radius defined by the ry attribute. An ellipse with a center at point (200,200) with an x-radius of 50 and a y-radius or 150 would look like
<ellipse cx="200" cy="200" rx="50" ry="150" />The lesson will style the circles and ellipses using a web standard called CSS, short for Cascading Style Sheets. CSS styles consist of name:value pairs separated by a semi-colon. Each name is separated from its value with a colon. For example, style="name:value;name:value;"
Syntax Examples:
An circle centered at (200,200) with a radius of 100 would have the following code:
<circle cx="200" cy="200" r="100" />
An ellipse centered at (200,200) with an x-radius of 50 and a y-radius of 150 would have
the following code:
<ellipse cx="200" cy="200" rx="50" ry="150" />
<g transform="rotate(0,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:red;" />
</g>
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:red;stroke-dasharray:3,2;" />
<g transform="rotate(0,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:red;stroke-dasharray:3,2;" />
<circle cx="150" cy="200" r="5" style="fill:red;" />
</g>
<g transform="rotate(0,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:red;stroke-dasharray:3,2;" />
<circle cx="150" cy="200" r="5" style="fill:red;" />
<circle cx="250" cy="200" r="5" style="fill:red;" />
</g>
<g transform="rotate(60,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:blue;stroke-dasharray:3,2;" />
<circle cx="150" cy="200" r="5" style="fill:blue;" />
<circle cx="250" cy="200" r="5" style="fill:blue;" />
</g>
<g transform="rotate(120,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:green;stroke-dasharray:3,2;" />
<circle cx="150" cy="200" r="5" style="fill:green;" />
<circle cx="250" cy="200" r="5" style="fill:green;" />
</g>
<circle cx="204" cy="196" r="5" style="fill:cyan;" />
<circle cx="194" cy="194" r="5" style="fill:orange;" />
<circle cx="194" cy="200" r="5" style="fill:cyan;" />
<circle cx="206" cy="206" r="5" style="fill:orange;" />
<g transform="rotate(0,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:red;" />
</g>
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:red;stroke-dasharray:3,2;" />
<g transform="rotate(0,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:red;stroke-dasharray:3,2;" />
<circle cx="150" cy="200" r="5" style="fill:red;" />
</g>
<g transform="rotate(0,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:red;stroke-dasharray:3,2;" />
<circle cx="150" cy="200" r="5" style="fill:red;" />
<circle cx="250" cy="200" r="5" style="fill:red;" />
</g>
<g transform="rotate(60,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:blue;stroke-dasharray:3,2;" />
<circle cx="150" cy="200" r="5" style="fill:blue;" />
<circle cx="250" cy="200" r="5" style="fill:blue;" />
</g>
<g transform="rotate(120,200,200)">
<ellipse cx="200" cy="200" rx="50" ry="150" style="fill:none;stroke:green;stroke-dasharray:3,2;" />
<circle cx="150" cy="200" r="5" style="fill:green;" />
<circle cx="250" cy="200" r="5" style="fill:green;" />
</g>
<circle cx="204" cy="196" r="5" style="fill:cyan;" />
<circle cx="194" cy="194" r="5" style="fill:orange;" />
<circle cx="194" cy="200" r="5" style="fill:cyan;" />
<circle cx="206" cy="206" r="5" style="fill:orange;" />