필터 지우기
필터 지우기

Tilted (inclined) circle in 3D

조회 수: 24 (최근 30일)
Mirzobek Malikov
Mirzobek Malikov 2022년 8월 22일
댓글: Star Strider 2022년 8월 23일
Hello,
I was attempting to incline (tilt) a circle at some degrees. The circle is lifted, so it has an arbitrary altitude and it must be inclined in 3D. I was trying to do it by applying a rotation matrix, but couldn't. Here's my code:
xm = 0;
ym = 0;
teta = linspace(0, 2*pi, 100);
x = r*cos(teta) + xm;
y = r*sin(teta) + ym;
inclined_angle = 22;
z = ones(1,length(x));
plot3(x, y, z);
Also, has attached a desired result, see picture below...

채택된 답변

Star Strider
Star Strider 2022년 8월 22일
I usually use the rotate function for these problems. It’s just esaier.
Try this —
r = 1;
xm = 0;
ym = 0;
teta = linspace(0, 2*pi, 100);
x = r*cos(teta) + xm;
y = r*sin(teta) + ym;
inclined_angle = 22;
z = ones(1,length(x));
figure
c = plot3(x, y, z);
grid on
xlabel('x')
ylabel('y')
axis('equal')
view(15,20)
rotate(c, [1 1 0], inclined_angle) % Inclines In 'x' and 'y' Directions
Make appropriate changes to get the result you want.
.
  댓글 수: 2
Mirzobek Malikov
Mirzobek Malikov 2022년 8월 23일
Thanks!
Star Strider
Star Strider 2022년 8월 23일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by