Main Content

이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.

rotate

지정된 원점과 방향을 기준으로 객체 회전

구문

rotate(h,direction,alpha)
rotate(...,origin)

설명

rotate 함수는 3차원 공간에서 그래픽스 객체를 회전시킵니다.

rotate(h,direction,alpha)는 그래픽스 객체 halpha도 회전시킵니다. h를 surface, patch, line, text 또는 image 객체로 지정하십시오. direction은 회전 축의 원점과 관련하여 회전 축을 설명하는, 요소를 2개 또는 3개 가진 벡터입니다. 회전 축의 디폴트 원점은 플롯 상자의 중심입니다. 이 점이 반드시 좌표축의 원점인 것은 아닙니다.

양의 alpha는 회전 원점에서 연장되면서 방향 벡터에 대한 오른손 법칙(Right-hand Rule) 각도로 정의됩니다.

h가 핸들로 구성된 배열인 경우, 모든 객체는 동일한 좌표축의 자식이어야 합니다.

rotate(...,origin)은 회전 축의 원점을 요소를 3개 가진 벡터 [x0,y0,z0]으로 지정합니다.

참고

Image 객체는 3차원 데이터를 지원하지 않습니다. 따라서 x-y 평면을 벗어나는 이미지 회전은 지원되지 않습니다.

예제

모두 축소

peaks 함수의 곡면 플롯을 만들고 surface 객체를 반환합니다.

s = surf(peaks(20));
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')

Figure contains an axes object. The axes object with xlabel x-axis, ylabel y-axis contains an object of type surface.

x축을 기준으로 곡면 플롯을 25도 회전합니다.

direction = [1 0 0];
rotate(s,direction,25)

Figure contains an axes object. The axes object with xlabel x-axis, ylabel y-axis contains an object of type surface.

peaks 함수의 곡면 플롯을 만들고 surface 객체를 반환합니다.

s = surf(peaks(20));
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')

Figure contains an axes object. The axes object with xlabel x-axis, ylabel y-axis contains an object of type surface.

y축을 기준으로 곡면 플롯을 25도 회전합니다.

direction = [0 1 0];
rotate(s,direction,25)

Figure contains an axes object. The axes object with xlabel x-axis, ylabel y-axis contains an object of type surface.

peaks 함수의 곡면 플롯을 만들고 surface 객체를 반환합니다.

s = surf(peaks(20));
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')

Figure contains an axes object. The axes object with xlabel x-axis, ylabel y-axis contains an object of type surface.

x축과 y축을 기준으로 곡면 플롯을 25도 회전합니다.

direction = [1 1 0];
rotate(s,direction,25)

Figure contains an axes object. The axes object with xlabel x-axis, ylabel y-axis contains an object of type surface.

회전 변환은 객체의 데이터를 수정합니다. 이 기법은 viewrotate3d처럼 시점만 수정하는 기법과는 다릅니다.

회전 축은 회전 원점과 점 P로 정의됩니다. P를 구면 좌표 [theta phi] 또는 카테시안 좌표(Cartesian Coordinate) [xp,yp,zp]로 지정하십시오.

Cartesian axes displaying the axis of rotation relative to an origin of rotation and point P

direction이 요소를 2개 가진 형식인 경우, thetax-y 평면에서 양의 x축을 기준으로 시계 반대 방향으로 측정한 각도입니다. phix-y 평면에서 방향 벡터의 고도각입니다.

Cartesian axes displaying the location of point P relative to theta and phi

3-요소 형식의 direction은 카테시안 좌표(Cartesian Coordinate)를 사용하여 축 방향을 지정합니다. 방향 벡터는 회전 원점에서 P까지의 벡터입니다.

rotateXdata, Ydata, Zdata 속성의 값을 변경하여 그래픽스 객체를 회전합니다.

버전 내역

R2006a 이전에 개발됨

참고 항목

| |