«atan2» 태그된 질문

15
atan2 ()를 0-360 도로 매핑하는 방법
atan2(y, x) 180 °에서 시계 방향으로 -180 ° ..0 °로 전환되는 불연속성이 있습니다. 값 범위를 0 ° ..360 °로 매핑하려면 어떻게합니까? 내 코드는 다음과 같습니다. CGSize deltaPoint = CGSizeMake(endPoint.x - startPoint.x, endPoint.y - startPoint.y); float swipeBearing = atan2f(deltaPoint.height, deltaPoint.width); startPoint및 endPoint두 XY 포인트 구조체가 주어지면 스 와이프 터치 이벤트의 방향을 …
108 math  quartz-2d  atan2 
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.