Borrar filtros
Borrar filtros

sphere with center and radius

255 visualizaciones (últimos 30 días)
GEORGIOS TSAKIRAKIS
GEORGIOS TSAKIRAKIS el 15 de Oct. de 2018
Comentada: DGM el 24 de En. de 2024
how to plot a sphere with center(6500000,6500000,6500000) and radius 650000

Respuesta aceptada

Akira Agata
Akira Agata el 15 de Oct. de 2018
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 comentario
GEORGIOS TSAKIRAKIS
GEORGIOS TSAKIRAKIS el 16 de Oct. de 2018
thank you very much! it works perfect

Iniciar sesión para comentar.

Más respuestas (2)

Image Analyst
Image Analyst el 15 de Oct. de 2018
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 comentarios
Image Analyst
Image Analyst el 24 de En. de 2024
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 el 24 de En. de 2024
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.

Iniciar sesión para comentar.


Ankita De
Ankita De el 11 de Jul. de 2022
can you please tell nearest neighbour and contact distance distribution using binomial point process

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by