[python] 원점 기준으로 좌표 회전

김우경·2021년 4월 15일
0

woosbrary

목록 보기
7/8

원점 기준 좌표를 특정 각도만큼 회전하는 공식은 다음과 같다.

rad = degree * (math.pi / 180.0)
nx = round(math.cos(rad)*x - math.sin(rad)*y)
ny = round(math.sin(rad)*x + math.cos(rad)*y)
profile
Hongik CE

0개의 댓글