I would like to draw a circular loop on spherical surface for a fixed orientation of theta(i.e. polar angle on sphere) and variying the azimuthal angle. The following code only generates the circle which are parallel to the equiatorial plane, but I need arbitrary orientation of ploar angle on the sphere. Pl somebody help me.
clear; clc;N=10;[X,Y,Z]=sphere(N);C=zeros(N+1,N+1);x=7;y=1;r=10;for i=1:N+1 for j=1:N+1 d=sqrt(((i-x)^2)+((j-y)^2)); if (d<=r) C(i,j)=1; end endendfiguresurf(X,Y,Z,C)axis equal
Best Answer