0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

geometry > arctan()の取り方 > y/x or x/y

Last updated at Posted at 2016-06-20

x,yから方向を計算するときatan2()関数使用時はy/xの逆正接を取る。

math.h

atan2 関数は y / x の逆正接 (arctan) を計算し,結果を double 型で返します.

office

ATAN2(a,b) と ATAN(b/a) は等しくなりますが、ATAN2 では a に値 0 を使用できる点が異なります。

一方で、x/yの逆正接を取る例もある。

Tilt along incline/Skew: arctan(y/x) or arctan(x/y) depending on where you want the angle relative to

角度がX軸からの角度なのか、Y軸からの角度なのかの違いなのだろう。

検算するときに混乱したのは上記の違いによるものだった。

0
1
0

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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?