Hello!
I am trying to plot a sphere in 3D. This is what i know so far.
[x,y,z] = sphere; surf(x+a,y+b,z+c);
now i know that (a b c) means that its a shift in the x y and z axis respectively but it also affects the radius at the same time. How can i create a shift like mention above but also scaling down the radius to something lower than 1?
Cheers!

 Akzeptierte Antwort

David Legland
David Legland am 24 Jul. 2012

4 Stimmen

Hi,
maybe by specifying the radius as a scaling factor:
surf(x*r+a, y*r+b, z*r+c);
axis equal;

3 Kommentare

Jesus Mendez
Jesus Mendez am 24 Jul. 2012
I dont know why but when i tried this it wouldnt work? i may have done something slightly different but yes this works just as intended thank you! :)
Nuno
Nuno am 9 Mai 2015
How i obtain the limit values of a sphere ?
Thank you so much!! It worked well!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by