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


Name

dist()

Examples
// Sets the background gray value based on
// the distance of the mouse from the center
void draw() {
  float d = dist(50, 50, mouseX, mouseY);
  fill(d*4);
  rect(0, 0, 99, 99);
}
Description 2つの点の距離を計算します。
Syntax
dist(x1, y1, x2, y2);
dist(x1, y1, z1, x2, y2, z2);
Parameters
x1 int or float: x-coordinate of the first point
y1 int or float: y-coordinate of the first point
z1 int or float: z-coordinate of the first point
x2 int or float: x-coordinate of the second point
y2 int or float: y-coordinate of the second point
z2 int or float: z-coordinate of the second point
Usage Web & Application
Updated on September 23, 2006 05:40:15pm PDT

Creative Commons License

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

© 2007 Processing.org