Hello matlabers,
I've been trying to plot concentric circles on the surface of a sphere as in the left half of the attached image. Ideally I'd like to make that plot and then perform a coordinate transformation of the circles into Cartesian coordinates which would produce the image on the right of the attachment. Anyone have experience in plotting concentric circles on the surface of a sphere?
Adam

댓글 수: 1

Adam Danz
Adam Danz 2015년 6월 23일
I forgot to attach the picture. here it is https://dl.dropboxusercontent.com/u/2388663/concentric%20c.png

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

 채택된 답변

Mukul Rao
Mukul Rao 2015년 6월 24일
편집: Mukul Rao 2015년 6월 24일

1 개 추천

Hi, please execute the code below to generate the sphere with concentric circles. There are many ways to implement this , I have just suggested one such workflow. To better understand what the terms mean, I would recommend reading a little about spherical co-ordinates to interpret the code.
%Generate custom sphere or use the sphere function
%Equation of sphere polar co-ordinates defined by theta , phi , z
R = 5; %Sphere radius
N = 200; %Number of phi-theta divisions
phi = linspace(0,pi,N);
theta = linspace(0,2*pi,N);
[PHI,THETA] = meshgrid(phi,theta);
Z = R* cos(PHI);
Rcircle = sqrt(R^2 - Z.^2);
%Map from spherical to cartesian while generating surf-plot
surf(Rcircle.*cos(THETA),Rcircle.*sin(THETA),Z,'LineStyle','none')
%Define the phi-coordinates for the circles you'd like to plot on the sphere
phiplot = linspace(0,pi,10) ; %You can replace this array to plot multiple circles of your choice
Zplot = R*cos(phiplot);
Rcircleplot = sqrt(R^2 - Zplot.^2); %Radius of the corresponding circle
hold on
plot3(cos(theta')*Rcircleplot,sin(theta')*Rcircleplot...
, Zplot'*ones(size(theta)),'LineWidth',2)
As far as the second half of your image is considered, one would need the details on the type of mapping to proceed.

댓글 수: 5

Adam Danz
Adam Danz 2015년 6월 25일
Thank you, Mukul. Worked well after changing the 3rd input to plot3: (Zplot'*ones(size(theta)))'
This is the starting point I was looking for. Thanks again.
Adam Danz
Adam Danz 2015년 6월 25일
Hello again,
I've been trying to convert the concentric circles generated by the plot3 function in Mukul's helpful code into the distortions depicted on the right side of this image:
https://dl.dropboxusercontent.com/u/2388663/concentric%20c.png
If I understand correctly, the circles generated in the plot3 function are plotted on the surface of a sphere but plotted in Cartesian coordinates. When these half-circles (as seen from 1 side of the sphere) are converted from spherical to planar coordinates, they should generate the distortions on the right of my drawing. I've only managed to convert them to either parallel lines or nonsense formations. If anyone has insight on this I'd be very grateful.
Adam
darova
darova 2019년 8월 10일
Here is what i achieved after long 4 years of research
img11.png img12.png
Malini Krishnan
Malini Krishnan 2019년 8월 19일
Timing! Wonderful work darova!!!
darova
darova 2019년 8월 19일
thanks =)

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

추가 답변 (0개)

카테고리

질문:

2015년 6월 23일

댓글:

2019년 8월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by