Created
December 26, 2015 11:19
-
-
Save shundroid/a07278762574ab1b6ed1 to your computer and use it in GitHub Desktop.
座標を角度に変える。ジョイスティックや加速度センサーのときに使える
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var posX = 0, posY = 0; // お好きな値に。 | |
var deg = Math.atan2(posY, posX) / (Math.PI / 180) + 180 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment