torus_yourlogin

torus_yourlogin - % radius_b - outer radius (units of...

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

View Full Document Right Arrow Icon
function [vol,surfarea] = torus_yourlogin(radius_a,radius_b) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Programmer(s) and Purdue Email Address(es): % 1. ENGR Faculty/Staff % % Section #: ALL % % Assignment #: Homework 3 Problem 5 % % 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. % % torus_yourlogin: calculates the volume and surface area of a torus given the inner and outer radii. % INPUTS: List them below one line per input argument % radius_a - inner radius (units of length)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % radius_b - outer radius (units of length) % OUTPUTS: List them below line per output argument % vol - torus volume (units of length^3) % surfarea - torus surface area (units of length^2) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ---- INPUTS ----% % ---- CALCULATIONS ----vol = 0.25*pi^2*(radius_a + radius_b)*(radius_b - radius_a)^2; % Calculates the volume (units of length^3) v surfarea = pi^2*(radius_b^2 - radius_a^2); % Calculates the surface area (units of length^2) l % ---- RESULTS: -----% % part i. % >>[v,sa]=torus_yourlogin(1,2) % % v = 7.4022 % sa = 29.6088 % % part ii. % >>[v,sa]=torus_yourlogin(7,13) % % v = 1.7765e+003 % sa = 1.1844e+003 %...
View Full Document

Ask a homework question - tutors are online