0
0

More than 3 years have passed since last update.

P5.js 日本語リファレンス(ellipse)

Last updated at Posted at 2020-08-01

このページでは「P5.js 日本語リファレンス」 の ellipse関数を説明します。

ellipse()

説明文

画面に楕円を描画します。幅と高さが等しい楕円は円です。最初の2つのパラメータは中心点を設定し、3番目と4番目のパラメータは楕円の幅と高さを設定します。高さが指定されていない場合、幅の値は幅と高さの両方に使用されます。負の高さまたは幅が指定されている場合は、絶対値が使用されます。原点は ellipseMode() で変更できます。

構文

ellipse(x, y, w, [h​​])

ellipse(x, y, w, h, detail)

パラメタ

  • x
    Number:楕円のx座標

  • y
    Number:楕円のy座標

  • w
    Number:楕円の幅

  • h
    Number:楕円の高さ (オプション)

  • detail
    Number:楕円を描画する頂点数(WebGLモードの場合)

例1

function setup() {
  createCanvas(200, 200, WEBGL);

  //中心点(0, 0)に幅105、高さ55、頂点数10の円を描画します。
  ellipse(0, 0, 105, 55, 10);
}

実行結果

著作権

p5.js was created by Lauren McCarthy and is developed by a community of collaborators, with support from the Processing Foundation and NYU ITP. Identity and graphic design by Jerel Johnson.

ライセンス

Creative Commons(CC BY-NC-SA 4.0) に従います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0