Skip to content

Instantly share code, notes, and snippets.

@shundroid
Created December 26, 2015 11:19
Show Gist options
  • Save shundroid/a07278762574ab1b6ed1 to your computer and use it in GitHub Desktop.
Save shundroid/a07278762574ab1b6ed1 to your computer and use it in GitHub Desktop.
座標を角度に変える。ジョイスティックや加速度センサーのときに使える
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