주요 콘텐츠

rotate

R2026b

설명

polyout = rotate(polyin,theta)는 기준점 (0,0)을 기준으로 polyin을 theta 각도로 회전하여 만든 polyshape 객체를 반환합니다.

예제

polyout = rotate(polyin,theta,refpoint)는 회전할 기준점을 지정합니다.

예제

예제

모두 축소

정사각형인 polyin을 만들고 점 (0,0)을 기준으로 시계 반대 방향으로 45도 회전합니다.

polyin = polyshape([0 0 1 1],[1 0 0 1]);
poly1 = rotate(polyin,45);

점 (1,0)을 기준으로 polyin 45도 회전합니다.

poly2 = rotate(polyin,45,[1 0]);

세 개의 다각형을 모두 플로팅합니다.

plot([polyin poly1 poly2])
axis equal

Three overlapping squares: the original axis-aligned square, one rotated 45 degrees about the origin, and one rotated 45 degrees about the point (1,0)

입력 인수

모두 축소

입력 polyshape로, 스칼라, 벡터, 행렬 또는 다차원 배열로 지정됩니다.

데이터형: polyshape

회전 각도로, 스칼라 각도로 지정됩니다. 입력 polyshape가 배열일 때 배열의 각 요소는 theta도 회전합니다. theta가 양수이면 시계 반대 방향으로, theta가 음수이면 시계 방향으로 회전합니다.

데이터형: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

기준점으로, x 좌표와 y 좌표의 2개 요소를 갖는 행 벡터로 지정됩니다. rotate 함수는 기준점을 기준으로 회전합니다. 입력 polyshape가 배열일 때 배열의 각 요소는 refpoint를 기준으로 회전됩니다.

데이터형: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

확장 기능

모두 확장

버전 내역

R2017b에 개발됨

참고 항목

| |