Draw a 3D circle. Possible calls for the function: drawCircle3d([XC YC ZC R THETA PHI]) drawCircle3d([XC YC ZC R], [THETA PHI]) where XC, YC, ZY are coordinates of circle center, R is the circle radius, PHI and THETA are 3D angles in degrees of the normal to the plane containing the circle: * THETA between 0 and 180 degrees, corresponding to the colatitude (angle with Oz axis). * PHI between 0 and 360 degrees corresponding to the longitude (angle with Ox axis) drawCircle3d([XC YC ZC R THETA PHI PSI]) drawCircle3d([XC YC ZC R], [THETA PHI PSI]) drawCircle3d([XC YC ZC R], THETA, PHI) drawCircle3d([XC YC ZC], R, THETA, PHI) drawCircle3d([XC YC ZC R], THETA, PHI, PSI) drawCircle3d([XC YC ZC], R, THETA, PHI, PSI) drawCircle3d(XC, YC, ZC, R, THETA, PHI) drawCircle3d(XC, YC, ZC, R, THETA, PHI, PSI) Are other possible syntaxes for this function. H = drawCircle3d(...) return handle on the created LINE object Example % display 3 mutually orthogonal 3D circles figure; hold on; drawCircle3d([10 20 30 50 0 0], 'LineWidth', 2, 'Color', 'b'); drawCircle3d([10 20 30 50 90 0], 'LineWidth', 2, 'Color', 'r'); drawCircle3d([10 20 30 50 90 90], 'LineWidth', 2, 'Color', 'g'); axis equal; axis([-50 100 -50 100 -50 100]); view([-10 20]) % Draw several circles at once center = [10 20 30]; circ1 = [center 50 0 0]; circ2 = [center 50 90 0]; circ3 = [center 50 90 90]; figure; hold on; drawCircle3d([circ1 ; circ2 ; circ3]); axis equal; See also: circles3d, drawCircleArc3d, drawEllipse3d, drawSphere
Package: matgeom