Math


オブジェクトを円運動させる公式

オブジェクトのX座標 = X
オブジェクトのY座標 = Y
円の中心のX座標 = CenterX
円の中心のY座標 = CenterY
角度(ラジアン) = Angle
横半径 = RadiusX
縦半径 = RadiusY
回転速度 = VR

X = CenterX + Math.cos(Angle) + RadiusX
Y = CenterY + Math.sin(Angle) + RadiusY
Angle += VR

RadiusX = RadiusY の時、正円運動。

カテゴリ:Math

タグ:,

Post at 2008年07月07日 21:28 | Permalink


角度のラジアンと度数の単位換算式

ラジアン : RAD
度 : DEG

RAD = DEG * Math.PI / 180
DEG = RAD * 180 / Math.PI

カテゴリ:Math

タグ:,

Post at 2008年06月30日 18:38 | Permalink


乱数 : R
最小値 : MIN
最大値 : MAX

R = Math.floor(Math.ramdom() * (MAX - MIN + 1)) + MIN

カテゴリ:Math

タグ:

Post at 2008年06月30日 18:35 | Permalink


時 : H
分 : M
秒 : S
ミリ秒 : MS

長針の角度 : H * (360 / 12) + M * (30 / 60)
短針の角度 : M * (360 / 60) + S * (6 / 60)
秒針の角度 : S * (360 / 60) + MS * (6 / 1000)

カテゴリ:Math

タグ:

Post at 2008年06月30日 18:20 | Permalink


温度の単位換算式

摂氏 : C
華氏 : F

C = ( F - 32 ) / 1.8
F = C * 1.8 + 32

カテゴリ:Math

タグ:,

Post at 2008年06月30日 18:12 | Permalink

<< 1 2


Math : 月別アーカイブ



Feed


Powered by Movable Type 4.27-ja

Hosted by heteml