Processing (BETA) version 135+ のリファレンスです。 旧バージョン使用者はソフトウェア内のリファレンスを参照してください。
この文書は Processing のAPIリファレンスを日本語に訳したものです。 最新の内容は 英語版 で確認して下さい。


Name

atan2()

Examples
void draw() {
  background(204);
  translate(width/2, height/2);
  float a = atan2(mouseY-height/2, mouseX-width/2);
  rotate(a);
  rect(-12, -5, 24, 10);
}
Description 正のx軸から指定した座標上の起点となる点までの角度(ラジアン)計算します。 値はPIから-PIまでの範囲のfloatで返します。 関数atan2()は幾何学をカーソルの位置に合わせる際に使われます。 注意: ポイントのy座標は最初のパラメタで指定し、x座標は2番目のパラメタで指定します。
Syntax
atan2(y, x);
Parameters
y int or float: y-coordinate of the point
x int or float: x-coordinate of the point
Usage Web & Application
Related tan()
Updated on September 23, 2006 05:40:18pm PDT

Creative Commons License

この文書の原文はクリエイティブ・コモンズ(Creative Commons)Attribution-Noncommercial-Share Alike(表示・非営利・継承) ライセンスで公開されています。 このライセンスは同一の許諾条件の下で原作者のクレジットを表示し、また作品を営利目的で利用しなければ、作品に対して複製、頒布、展示、実演、二次的著作物の作成が行えることを示します。

© 2007 Processing.org