物理の駅 Physics station by 現役研究者

テクノロジーは共有されてこそ栄える

tan空間角度と、ラジアン空間の角度の話

3次元角度がtan空間で次のように与えられたとき

ベクトル1

 \displaystyle
  \left( tan\theta _{x1}, tan\theta _{y1}, 1\right)=\overrightarrow {V_1}

ベクトル2

 \displaystyle
  \left( tan\theta _{x2}, tan\theta _{y2}, 1\right)=\overrightarrow {V_2}

角度差は

 \displaystyle
  \Delta tan\theta = \sqrt {\left( tan\theta _{x1} - tan\theta _{x2}\right)^{2}+\left( tan\theta _{y1} - tan\theta _{y2}\right)^{2} }

cosθはドット積を用いて

 \displaystyle
  \overrightarrow {V_1} \cdot  \overrightarrow {V_2} = 
\left| \overrightarrow {V_1}\right| \left| \overrightarrow {V_2}\right| cos\left( \Delta \theta \right)

のように与えられるので、

 \displaystyle
cos\left( \Delta \theta \right) = \dfrac {tan\theta_{x1}tan\theta_{x2}+tan\theta_{y1}tan\theta_{y2}+1} {\sqrt{tan^2\theta_{x1}+tan^{2}\theta_{y1}+1}\cdot \sqrt{tan^2\theta_{x2}+tan^{2}\theta_{y2}+1}}

よってΔθは

 \displaystyle
\Delta \theta = arccos\left( \dfrac {tan\theta_{x1}tan\theta_{x2}+tan\theta_{y1}tan\theta_{y2}+1} {\sqrt{tan^2\theta_{x1}+tan^{2}\theta_{y1}+1}\cdot \sqrt{tan^2\theta_{x2}+tan^{2}\theta_{y2}+1}} \right)

となる

arccosC++だとacosで計算可能。