rks3_1 - area_of_triangle = r^2 * cos(theta/2) *...

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

View Full Document Right Arrow Icon
%Engineering 6, Winter 2006, Problem 3.1 %Raminderdeep Sidhu, 7987 %Section A01, Thursday 8- 8:50 %find the area of the shaded semicircular portion given the radius 5 cm and %get the input from the user for angle. clc; format short; a = input('enter a value for the angle a between 0 to 180 degrees '); %convert the angle from the degrees to radians theta = (a * pi)/180; r = 5; %radius of circle in cm total_area = pi * r ^ 2; area_of_sector = (theta * r^2) / 2; %find the area of the sector %area of the triangle
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: area_of_triangle = r^2 * cos(theta/2) * sin(theta/2); %to get the area of the shaded region area_of_shaded_region = (area_of_sector) - (area_of_triangle); disp('area of shaded region in centimeters sqa'),disp(area_of_shaded_region); %calculate the percentage of the total area that the shaded region area %takes up disp('area of circle in centimeters square'),disp(total_area); percentage = (area_of_shaded_region / total_area) * 100; disp('percentage'),disp(percentage);...
View Full Document

This note was uploaded on 04/21/2010 for the course ENGINEERIN 87897 taught by Professor Noclue during the Spring '07 term at UC Davis.

Ask a homework question - tutors are online