Processing (BETA) version 135+ のリファレンスです。
旧バージョン使用者はソフトウェア内のリファレンスを参照してください。
この文書は Processing のAPIリファレンスを日本語に訳したものです。
最新の内容は 英語版 で確認して下さい。
| Name | bezierTangent() |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Examples | ![]() bezier(85, 20, 10, 10, 90, 90, 15, 80);
int steps = 6;
for (int i = 0; i <= steps; i++) {
float t = i / float(steps);
// Get the location of the point
float x = bezierPoint(85, 10, 90, 15, t);
float y = bezierPoint(20, 10, 90, 80, t);
// Get the tangent points
float tx = bezierTangent(85, 10, 90, 15, t);
float ty = bezierTangent(20, 10, 90, 80, t);
// Calculate an angle from the tangent points
float a = atan2(ty, tx);
stroke(255, 102, 0);
line(x, y, cos(a)*30 + x, sin(a)*30 + y);
// This follwing line of code makes a line
// inverse of the above line
//line(x, y, cos(a)*-30 + x, sin(a)*-30 + y);
stroke(0);
ellipse(x, y, 5, 5);
}![]() bezier(85, 20, 10, 10, 90, 90, 15, 80);
stroke(255, 102, 0);
int steps = 16;
for (int i = 0; i <= steps; i++) {
float t = i / float(steps);
float x = bezierPoint(85, 10, 90, 15, t);
float y = bezierPoint(20, 10, 90, 80, t);
float tx = bezierTangent(85, 10, 90, 15, t);
float ty = bezierTangent(20, 10, 90, 80, t);
float a = atan2(ty, tx);
a += PI/2.0;
line(x, y, cos(a)*8 + x, sin(a)*8 + y);
} |
||||||||||
| Description | ベジエ曲線上の接点を計算します。 "tangent"の分かりやすい定義は Wikipedia: http://en.wikipedia.org/wiki/Tangentにあります。 | ||||||||||
| Syntax | bezierPoint(a, b, c, d, t) |
||||||||||
| Parameters |
|
||||||||||
| Usage | Web & Application | ||||||||||
| Related | bezier() bezierVertex() curvePoint() |
この文書の原文はクリエイティブ・コモンズ(Creative Commons)のAttribution-Noncommercial-Share Alike(表示・非営利・継承) ライセンスで公開されています。
このライセンスは同一の許諾条件の下で原作者のクレジットを表示し、また作品を営利目的で利用しなければ、作品に対して複製、頒布、展示、実演、二次的著作物の作成が行えることを示します。
© 2007 Processing.org
© 2007 Processing.org



