whirlpool - % - the figure should be titled 'Whirlpool!'...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% 10/21/2009 1:48 PM % Function Name: whirlpool % Inputs: 1. double - the total height of the whirlpool % 2. double - the intensity of the whirlpool % % Function Description: % Write a function that plots a whirlpool in the following fashion: % - theta is (2*height*intensity) evenly spaced points between 0 and % height/2 % - x and y are defined as circles, with the radius being the current % height (z) and the angles being theta*intensity % - z is theta % - x, y,and z are plotted on the same graph as -x, -y, and -z. All % lines should be black
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % - the figure should be titled 'Whirlpool!' and should show a grid % function whirlpool(h, i) theta = linspace(0, h./2, 2*h*i); % theta goes from 0 to h/2 z = theta; % z goes from 0 to h/2 x = z.*cos(theta.*i); % x is radius(z) times cos of angle times i y = z.*sin(theta.*i); % y is radius(z) times sin of angle times i grid on hold on title('Whirlpool!'); plot3(x,y,z,'k'); % plots top of whirlpool plot3(-x,-y,-z,'k'); % plots bottom of whirlpool view(3); % setting view to default 3D view end...
View Full Document

This note was uploaded on 10/27/2009 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online