SVG <ellipse>


SVG 楕円形 - <ellipse>

<ellipse> 要素は、楕円を作成するために使用します。

楕円は、密接に円と関連しています。楕円の半径は x と y が互いに異なっているのに対し、円の半径は x と y が等しいところに違いがあります:


例 1

次の例では、楕円を作成しています:

Sorry, your browser does not support inline SVG.

SVG コードは次の通りです:

<svg height="140" width="500">
  <ellipse cx="200" cy="80" rx="100" ry="50"
  style="fill:yellow;stroke:purple;stroke-width:2" />
</svg>
Try it Yourself »

コードの説明:


例 2

次の例では、互いの上に 3 つの楕円を作成しています:

Sorry, your browser does not support inline SVG.

SVG コードは次の通りです:

<svg height="150" width="500">
  <ellipse cx="240" cy="100" rx="220" ry="30" style="fill:purple" />
  <ellipse cx="220" cy="70" rx="190" ry="20" style="fill:lime" />
  <ellipse cx="210" cy="45" rx="170" ry="15" style="fill:yellow" />
</svg>
Try it Yourself »

例 3

次の例では、2 つの楕円(黄と白)を組み合わせています:

Sorry, your browser does not support inline SVG.

SVG コードは次の通りです:

<svg height="100" width="500">
  <ellipse cx="240" cy="50" rx="220" ry="30" style="fill:yellow" />
  <ellipse cx="220" cy="50" rx="190" ry="20" style="fill:white" />
</svg>
Try it Yourself »