トピック
PChicken NerdChicken

How to calculate a rotation° from the circle pad?

wats the formula, i won't learn any of this math until i'm at least in highschool.
4そうだね
プレイ済み
返信[1]
親投稿
Alex MrCashews
the angle the circle pad is pointing is given by: STICK OUT SX#,SY# ANGLE#=ATAN(SY#,SX#) the #s after the variable names means they're realtypes. depending on your code they may or may not be there, it's just how I write it. Keep in mind Y comes first in ATAN. Angle is returned in RADIANS not degrees. 0° is stick pointing left, 90° is up, and so on.
1そうだね
プレイ済み
返信[2]
親投稿
Hanzo rzsense
Like Alex says, angle is returned in radian with his method. If you want to get angle in degree, write "DEG(ATAN(SY#,SX#))" instead of "ATAN(SY#,SX#)". Angle is 0deg when stick is pointing right. The maximum (minimum) angle is +180deg (-180deg) if you turn stick counterclockwise (clockwise) from 0deg position.
0そうだね
未プレイ
返信[3]
親投稿
PChicken NerdChicken
thanks!
1そうだね
プレイ済み