RSS | Twitter | Facebook
Home » ActionScript » Math.atan, Math.atan2 : ActionScript

Math.atan, Math.atan2 : ActionScript

Math.atan, Math.atan2の覚書。

ActionScriptの逆正接関数(アークタンジェント)はMath.atan,Math.atan2の2つがある。

arctan2.png
ActionScriptのY座標は下向きが正。
Math.atan()の引数は三角比。上の図では例えば(x/y)。

-x/-y = x/yなのでMath.atanは同じ値(θ)を返す。

一方、Math.atan2は引数を二つとり、Math.atan2(y, x)はθを、Math.atan2(-y,-x)はθ’を返す。
引数の順番に注意。

atanの戻り値は-π/2 ~ π/2。

このページの上へ移動

  Yahoo!ブックマークに登録    Google  この記事をクリップ!  BuzzurlにブックマークBuzzurlにブックマーク

2008/5/5 月 | ActionScript, math, trigonometric, 三角関数, 数学 | 固定リンク |

Trackbacks

  1. [...] Math.atan, Math.atan2 : ActionScript | findxfine -世界中の素敵なWeb技術をご紹介- (tags: actionscript math) [...]

    ピンバック by links for 2008-06-10 « test — 2008/6/10 火曜日 @ 12:32:25


コメント

コメントの投稿

改行と段落タグは自動で挿入されます。メールアドレスは表示されません。
利用可能な HTML タグ :
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite="">
<cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(必須)

(必須)


トラックバックURL

このページの上へ移動