필터 지우기
필터 지우기

sphere with center and radius

조회 수: 255 (최근 30일)
GEORGIOS TSAKIRAKIS
GEORGIOS TSAKIRAKIS 2018년 10월 15일
댓글: DGM 2024년 1월 24일
how to plot a sphere with center(6500000,6500000,6500000) and radius 650000

채택된 답변

Akira Agata
Akira Agata 2018년 10월 15일
How about this?
[x,y,z] = sphere;
x = x*650000;
y = y*650000;
z = z*650000;
figure
surf(x+650000,y+650000,z+650000)
  댓글 수: 1
GEORGIOS TSAKIRAKIS
GEORGIOS TSAKIRAKIS 2018년 10월 16일
thank you very much! it works perfect

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

추가 답변 (2개)

Image Analyst
Image Analyst 2018년 10월 15일
Try this:
% Make unit sphere
[x,y,z] = sphere;
% Scale to desire radius.
radius = 650000;
x = x * radius;
y = y * radius;
z = z * radius;
% Translate sphere to new location.
offset = 6500000;
% Plot as surface.
surf(x+offset,y+offset,z+offset)
% Label axes.
xlabel('X', 'FontSize', 20);
ylabel('Y', 'FontSize', 20);
zlabel('Z', 'FontSize', 20);
axis equal;
  댓글 수: 8
Image Analyst
Image Analyst 2024년 1월 24일
I don't know from that function, but you can of course easily generate your own coordinates on the shell of the sphere. For any given z value, it's simply a circle. See the FAQ:
DGM
DGM 2024년 1월 24일
See also:
That is one way to use plot3() to draw a spherical shell. Once you have the x,y,z data, you can offset it to the desired center.
If it's not actually necessary to use plot3() specifically, or if the sphere needs to be drawn in some other manner, then you'll have to say.

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


Ankita De
Ankita De 2022년 7월 11일
can you please tell nearest neighbour and contact distance distribution using binomial point process

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by