필터 지우기
필터 지우기

3차원상의 구 그리기.

조회 수: 3 (최근 30일)
병준
병준 2022년 10월 28일
답변: Nithin Kumar 2023년 6월 8일
ezsurf('r.*cos(pi)*cos(theta)','r.*sin(pi)','r.*cos(pi)*sin(theta)',[0 2*pi 0 2*pi])
이렇게 입력했는데 곡깔이 나와요
구로 표현될수있게 변경 부탁드려요.

답변 (1개)

Nithin Kumar
Nithin Kumar 2023년 6월 8일
Hi,
I understand that you are facing an issue while drawing a sphere in 3D.
To draw a sphere, you should use the “ezsurf” function as mentioned below:
ezsurf('cos(u).*sin(v)', 'sin(u).*sin(v)', 'cos(v)', [0, 2*pi, 0, pi])
The above command plots a sphere of radius "1" centered at the origin by parametrizing the sphere using spherical coordinates. The first argument corresponds to the x-coordinate, the second argument corresponds to the y-coordinate and the third argument corresponds to the z-coordinate.The ranges for "u" and "v" are specified as [0, 2*pi] and [0, pi] respectively, to cover the entire sphere.
For more information regarding "ezsurf" function, kindly refer to ezsurf function.
I hope this answer resolves the issue you are encountering.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!