- 직각 삼각형의 두 변의 길이를 Rx, Ry라고 할 때 arc tangent를 사용하여 각도 θ를 구하는 방법.
(이 때 θ는 라디안 값이다.)
- Radian을 Degree로 변경하기
1 radian = 180 / PI = 57.295779513082323°
- 프로그램 - 두 점 (px1, py1)과 (px2, py2)를 연결하는 선분의 각도 구하기
int px1, py1;
int px2, py2;
float calculateAngle() {
float dx = px1 - px2;
float dy = py1 - py2;
double radian = Math.atan(dx / dy);
float degree = (float) (57.295779513082323 * radian);
return degree;
}
'Etc.' 카테고리의 다른 글
생초보 기타 입문 가이드 (0) | 2012.09.15 |
---|---|
그래픽 표시 해상도 [graphic display resolution] (0) | 2012.01.14 |
Airport Codes (0) | 2012.01.03 |
VirtualBox를 이용한 Windows7 설치 (0) | 2009.10.07 |