LoginSignup
2
1

More than 5 years have passed since last update.

2つの座標から方角を360度に変換

Posted at

float angle = ((Math.atan((endPoint.y - startPoint.y) / (endPoint.x - startPoint.x)) / Math.PI + ((endPoint.x - startPoint.x) < 0)) * 180 + 720) % 360;

2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1