torus_rpereir - % % a and b - the raddi needed to calculate...

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

View Full Document Right Arrow Icon
function [ V,A ] = torus_rpereir( a,b ) f %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % Programmer(s) and Purdue Email Address(es): % % 1. rpereir@purdue.edu % % % Section #: 07 % % % Assignment #: homework 3 activty % % % Academic Integrity Statement: % % % I/We have not used source code obtained from % % any other unauthorized source, either modified % % or unmodified. Neither have I/we provided access % % to my/our code to another. The project I/we am/are % % submitting is my/our own original work. % % % FUNCTION NAME: calulates the volume and surface area of a torus % % INPUTS: List them below one line per input argument
Background image of page 1

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

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

Unformatted text preview: % % a and b - the raddi needed to calculate volume and surface area % % % % OUTPUTS: List them below line per output argument % % V and A - volume and area % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % V=(.25*pi^2*(a+b)*(b-a)^2); %calculates volume V A=pi^2*(b^2-a^2); %calculates surface area A A % [V,A]=torus_rpereir(1,2) % % % % V = % % % % 7.4022 % % % % % % A = % % % % 29.6088 % % % % [V,A]=torus_rpereir(7,13) % % % % V = % % % % 1.7765e+003 % % % % % % A = % % % % 1.1844e+003 % end e...
View Full Document

Page1 / 2

torus_rpereir - % % a and b - the raddi needed to calculate...

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