ellipse

ellipse - Eric Young Script ellipse Estimates the perimeter...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
% Eric Young % Script ellipse % Estimates the perimeter of an ellipse of the form (x/a)^2 + (y/b)^2 = 1, % where a and b are the semiaxes, using eight different formulas. % disp(' ') % Displays an empty line for aesthetics disp('Program calculates perimeter of an ellipse of the form (x/a)^2 + (y/b)^2 = 1 with semiaxes a and b using eight different formulas.') disp(' ') % Displays an empty line for aesthetics d a = input('Enter a: '); % Input semiaxe length a for ellipse disp(' ') % Displays an empty line for aesthetics b = input('Enter b: '); % Input semiaxe length b for ellipse b clc c % Displays a and b % disp(sprintf('a = %.1f is one semiaxe length of the ellipse.',a)) disp(' ') % Displays an empty line for aesthetics disp(sprintf('b = %.1f is the other semiaxe length of the ellipse.',b)) d % Calculates h, the departure from circle hood factor, from a and b % h = ((a-b)/(a+b))^2; h disp(' ') % Displays an empty line for aesthetics disp(sprintf(' h = %.7f',h)) disp(' ') % Displays an empty line for aesthetics
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/12/2009 for the course CS 100 taught by Professor Fan/vanloan during the Fall '07 term at Cornell.

Page1 / 2

ellipse - Eric Young Script ellipse Estimates the perimeter...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online