|
Tim Davis,
Prof. P.O. Box 116120 University of Florida Gainesville, FL 32611-6120 phone (352) 392-1481, fax (352) 392-1220 email: my last name AT cise.ufl.edu |
Timothy A. Davis and Kermit Sigmon, 2005. Published by CRC Press. ( buy it at CRC Press ) ( buy it at Amazon.com )
|
|
|
|
|
|
|
Below is the raw MATLAB code that generates the seashells above (more details are in seashell.m) The back cover uses a=-0.5. Cut and paste the following into your MATLAB command window. For a figure that's easier to rotate, use a smaller resolution (change '512' in linspace to 64).
|
figure(1) ; clf t = linspace(0, 2*pi, 512) ; [u,v] = meshgrid(t) ; a = -0.2 ; b = .5 ; c = .1 ; n = 2 ; x = (a*(1-v/(2*pi)) .* (1+cos(u)) + c) .* cos(n*v) ; y = (a*(1-v/(2*pi)) .* (1+cos(u)) + c) .* sin(n*v) ; z = b*v/(2*pi) + a*(1-v/(2*pi)) .* sin(u) ; surf(x,y,z,y) shading interp axis off axis equal colormap(hsv(1024)) material shiny lighting gouraud lightangle(80, -40) lightangle(-90, 60) view([-150 10]) |