logo

아크탄젠트2 함수의 정의 📂함수

아크탄젠트2 함수의 정의

정의

아크탄젠트2arc Tangent 2 $\arctan 2 : \left( \mathbb{R}^{2} \setminus \left\{ (0,0) \right\} \right) \to \mathbb{R}$ 는 다음과 같이 정의된다. $$ \arctan 2 : \left( r \sin \theta , r \cos \theta \right) \mapsto \theta $$ $r > 0$ 는 임의의 양수다.

설명

아크탄젠트2는 기계공학 등에서 아크탄젠트 $\arctan$ 로는 부족한 정보를 채우기 위해 사용되는 함수로써, 위치정보 $r \cos$, $r \sin$ 을 알아도 탄젠트 ${{ \sin } \over { \cos }}$ 가 되며 부호가 사라지는 문제를 보완한다. 정의역에서 알 수 있듯 $(0,0)$ 에서는 여전히 정의되지 않는다.

$\arctan$ 과의 차이점

보다시피 아크탄젠트는 $(1,1)$ 과 $(-1,-1)$ 을 구분하지 못하지만, 아크탄젠트2는 구분할 수 있다.

컨벤션

$x = \cos$ 이고 $y = \sin$ 이라 할 때 C 언어, 매트랩에서는 $\theta = \arctan 2 (y,x)$ 인데 어떤 곳에서는 또 $\theta = \arctan 2 (x,y)$ 라고 한다. 사인-코사인 순서대로 한다면 $\arctan 2 (\sin, \cos)$ 이 자연스럽고 x-y 순서대로 한다면 $\arctan 2 (x,y)$ 가 자연스러운 수준의 차이니까 그때그때 주의하는 수밖에 없다.

이러한 컨벤션의 차이에서도 느낄 수 있듯, 아크탄젠트2는 수학적으로 어떤 큰 의미가 있다기보다는 오로지 실용성 하나를 위해서 2를 붙여쓸 뿐이다. 역기구학inverse Kinematics에서 자주 등장하는 다음의 정리를 소개한다.

정리

삼각함수의 선형결합이 주어졌을 때의 각도

$$ a \cos \theta + b \sin \theta = c $$ 삼각함수선형결합이 $c \in \mathbb{R}$ 와 같다면, 각도 $\theta$ 는 다음과 같다. $$ \begin{align*} \cos \theta =& {{ ac \pm \sqrt{ b^{2} \left( a^{2} + b_{2} - c^{2} \right) } } \over { a^{2} + b^{2} }} \\ \sin \theta =& {{ b^{2} c \mp a \sqrt{ b^{2} \left( a^{2} + b^{2} - c^{2} \right) } } \over { b \left( a^{2} + b^{2} \right) }} \\ \theta =& \arctan2 \left( \sin \theta , \cos \theta \right) \end{align*} $$ 특히 $c = 0$ 일 때는 다음과 같이 더 간단한 꼴을 사용할 수 있다. $$ \begin{align*} \cos \theta =& \pm \sqrt{ {{ b^{2} } \over { a^{2} + b^{2} }} } \\ \sin \theta =& \mp {{ a } \over { b }} \sqrt{ {{ b^{2} } \over { a^{2} + b^{2} }} } \\ \theta =& \arctan2 \left( \sin \theta , \cos \theta \right) \end{align*} $$

증명

전략: 근본적으로 근의 공식을 사용할 뿐이다.

근의 공식: 이차방정식 $ax^{2}+bx+c=0$ (단, $a\neq 0$)에 대해 $$ x=\dfrac{ -b\pm \sqrt { b^{2}-4ac } }{2a} $$


$\sin \theta = \sqrt{ 1 - \cos^{2} \theta}$ 이므로 $$ \begin{align*} & a \cos \theta + b \sin \theta = c \\ \implies & a \cos \theta - c = - b \sin \theta \\ \implies & a^{2} \cos^{2} \theta - 2 ac \cos \theta + c^{2} = b^{2} \left( 1 - \cos^{2} \theta \right) \\ \implies & a^{2} \cos^{2} \theta - 2 ac \cos \theta + c^{2} = b^{2} \left( 1 - \cos^{2} \theta \right) \\ \implies & \left( a^{2} + b^{2} \right) \cos^{2} \theta - 2 ac \cos \theta + \left( c^{2} - b^{2} \right) = 0 \end{align*} $$ 1차항이 2의 배수일 때의 근의 공식에 따라 $$ \begin{align*} \cos \theta =& {{ ac \pm \sqrt{ a^{2} c^{2} - \left( a^{2} + b^{2} \right) \left( c^{2} - b^{2} \right) } } \over { a^{2} + b^{2} }} \\ =& {{ ac \pm \sqrt{ - b^{2} c^{2} + a^{2} b^{2} + b^{4} } } \over { a^{2} + b^{2} }} \end{align*} $$ 한편 $\sin \theta = {{ c - a \cos \theta } \over { b }}$ 이므로 $$ \begin{align*} \sin \theta =& {{ c - a \cos \theta } \over { b }} \\ =& {{ c - a {{ ac \pm \sqrt{ b^{2} \left( a^{2} + b_{2} - c^{2} \right) } } \over { a^{2} + b^{2} }}} \over { b }} \\ =& {{ c } \over { b }} - {{ a^{2} c \pm a \sqrt{ b^{2} \left( a^{2} + b_{2} - c^{2} \right) } } \over { b \left( a^{2} + b^{2} \right) }} \\ =& {{ c \left( a^{2} + b^{2} \right) } \over { b }} - {{ a^{2} c \pm a \sqrt{ b^{2} \left( a^{2} + b_{2} - c^{2} \right) } } \over { b \left( a^{2} + b^{2} \right) }} \\ =& - {{ b^{2} c \pm a \sqrt{ b^{2} \left( a^{2} + b_{2} - c^{2} \right) } } \over { b \left( a^{2} + b^{2} \right) }} \end{align*} $$ 이다. 사인과 코사인을 알았으니 아크탄젠트2에 우리가 원하던 $\theta = \arctan2 \left( \sin \theta , \cos \theta \right)$ 을 얻는다.