% note: this is a pseudoperiodic spline by adding to the ends and then % deleting the extra points at the ends. % My copy of MATLAB doesn't seem to have a routine for periodic % splines. See myspline for comparison. x1=[0,0,3,-2,0,0,-3,2,0,0,3,-2,0,0,-3,2,0]; y1=[-3,2,0,0,3,-2,0,0,-3,2,0,0,3,-2,0,0,-3]; z1=[2.44949,1.73205,-2.44949,-1.73205,2.44949,1.73205,-2.44949,-1.73205,2.44949, 1.73205,-2.44949,-1.73205,2.44949,1.73205,-2.44949,-1.73205,2.44949]; t=1:17; ts=1:.1:17; xs=spline(t,x1,ts); ys=spline(t,y1,ts); zs=spline(t,z1,ts); xp=xs(41:121); yp=ys(41:121); zp=zs(41:121); % Now for the plots: AZ = -32.5; EL = 45; view(AZ,EL); subplot(2,2,1); plot3(xp,yp,zp,'k'); AZ = -37.5; EL = 45; subplot(2,2,2); view(AZ,EL); subplot(2,2,3); AZ = 55; EL = 30; view(AZ,EL); AZ1=AZ-5; subplot(2,2,4) view(AZ1,EL)