Problem #2 .Calculate the volume and surface area of a torus from the minor radius r and major radius R. The equation for the volume of a torus i:s and the equation for the surface area of a torus is A = 4㎡Ar Your script should read-in values for the minor radius and major radius and display the calculated values with appropriate units. The units should also be read-in. Test your program for the following two cases: . Or-5in and R-15in 2 r 12 mm and R- 75 mm in m. file
MatLab program
clear all
clc
% minor radius
r=input('enter minor radius r: ');
% major radius
R=input('enter major radius R: ');
% units
fprintf('\n enter 1 if units is in inches');
fprintf('\n enter 2 if units is in mm');
i=input(': ');
A=pi^2*(R^2-r^2);
V=2*pi^2*r^2*R;
if i==1
fprintf('\n Surface area=%.2f in^2',A);
fprintf('\n Volume = %.2f in^3',V);
elseif i==2
fprintf('\n Surface area=%.2f mm^2',A);
fprintf('\n Volume = %.2f mm^3',V);
end
Screenshot
Save the above program and execute it.
Result
I hope this will help you.
Problem #2 .Calculate the volume and surface area of a torus from the minor radius r...
1. A torus has 2 parameters r and r that are related to the equation a) Based on the above equation, what is a and b for the torus? b) Use double integral to get the volume of this torus. c) Use double integral to get the surface area of this torus. d) Let's say you have a circle on the xy-axis with the centre (a, a) and radius b as shown in the figure below, where a > b....
?Construct a flowchart for your algorithm.? Construct a hierarchy chart for your algorithm.? 3) (10 pts) Develop and algorithm to calculate the surface area and internal volume of a torus. A torus is a 3-dimensional surface created by revolving a circle through its center around an axis coplanar with the circle. An example of a torus is depicted in Figure 1. The formulae to calculate the volume and area of a ring or horn torus are Where: A: V: R:...
1. A torus has 2 parameters r and r that are related to the equation a) Based on the above equation, what is a and b for the torus? b) Use double integral to get the volume of this torus c) Use double integral to get the surface area of this torus. 1. A torus has 2 parameters r and r that are related to the equation a) Based on the above equation, what is a and b for the...
Matlab A forus is shaped like a doughnut. If its inner radius isa and its outer radius is b, its volume and surface area are given by V '(a + b(b - a)? A = (b2 - ) a. Create a user-defined function that computes V and A from the arguments a and b. LastName_FirstName_P4_fn_calc. b. Test for values where acb, ab and aub. Use values between 1 and 10 for a and b. Your output should show a, b,...
Eide Problem 5.19: It is expected that power functions represent the surface area and volume of a certain geometric shape. The values of the surface area and volume are given for different radius values in the table below. Radius, R (ft) 1 2 3 5 6 Surface Area, SA (ft) | Volume, V (ft) 12.6 4.19 50.3 33.5 113 113 200 268 314 524 450 905 616 1437 800 2145 1018 3054 1257 4189 7 T 8 10 In Excel,...
6. Consider a cylinder with a surface area of 2 m2. Find the radius r and height h of such a cylinder so that the volume of the cylinder is a maximum. Given: For a cylinder, the surface area is S = 2^r2 + 2trh and the volume is V = arh (where r is the radius and h is the height of the cylinder). I (5)
A sphere of radius r has surface area A = 4πr2 and volume V = (4/3) πr3. The radius of sphere 2 is double the radius of sphere 1. (a)What is the ratio of the areas, A2/A1? (b)What is the ratio of the volumes, V2/V1?
Write a program to calculate the volume and surface area of a sphere from it radius given as input. Here are some formulas that might be useful: V = 4/3πr3 A = 4 πr2
write a c programming Write a program that will calculate the perimeter, area and volume of a is is entered by the user. Your program will display the radius, perimeter, area and volume to the monitor and will also save them to a file called "circlePAV.txt". Your program should prompt the user for the radius until the user enters -1. Use the following structure. typedef struct ( float radius; float area, float perimeter; float volume; ylinder Figure>
Calculates the dimensions for various fish pond configurations. Specifically, the program will calculate the volume for the pond in cubic feet, the surface area of the sides and bottom of the fish pond, and the area of a 2-foot wide border around the edge of the pond.Ponds come in predefined sizes and shapes. There are: - circular ponds, diameter: 5 feet - square ponds, side: 5 feet - rectangular ponds, dimensions: 4 feet by 7 feet - ovoid ponds, dimensions:...