Lab A - 4-A.5 % % % % % % % % % % % file name =>...

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

View Full Document Right Arrow Icon
4-A.5 % file name => computeSASarea.m % Computes the area of a triangle knowing two sides and the % angle between the two sides. % Assumed variables: % a, b: two sides of the triangle (ft) % alpha, the angle between a and b (deg) % sample set up: % a = 12; b = 2; % feet % alpha = 78; % deg % name of computed variables % SAS_TriangleArea alphaRad = alpha * (pi/180); % deg SAS_TriangleArea = (1/2) * a * b * sin(alphaRad) % sq ft 4-A.6 % file name => computeSSSarea.m % Computes the area of a triangle the lengths of all three % sides. % Assumed variables: % a, b, c: all three sides of the triangle (ft) % sample set up: % a = 12; b = 10; c=15; % feet % name of computed variables % SSS_TriangleArea S = (a + b + c) / 2; % ft - the semiperimeter SSS_TriangleArea = sqrt(S * (S-a) * (S-b) * (S-c) ) % sq ft % The expression above for SSS_TriangleArea can be % rewritten as % 1/4*(-(a+b+c)*(a-b-c)*(a-b+c)*(a+b-c))^(1/2) 4-A.7 % file name => twoTriangles.m % Computes the area of a rhombus constructed of two % triangles: T1 and T2. For T1 we know two sides a and b, % and the angle alpha which a makes with b. For T2, the side % b is common with T1, and we know the other two sides c and % d. Areas of T1 and T2 are found using other scripts, then % the area of the rhombus is found by adding T1 and T2. % Assumed variables: % a, b, c, d as described above (ft) % alpha as described above (deg) % sample set up: % a=3; b=5; c=7; d=15; % feet % alpha=32; % deg % name of computed variables % sumBothTriangles % USES SCRIPTS % computeSASarea and computeSSSarea % Use computeSAS area to compute area of triangle formed % by a-ALPHA-b. Note the variables expected by computeSAS
Background image of page 1

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

View Full DocumentRight Arrow Icon
% area are compatible with the varaibles expected by % twoTriangles. computeSASarea
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/30/2008 for the course CSE 131 taught by Professor Sticklen during the Spring '08 term at Michigan State University.

Page1 / 5

Lab A - 4-A.5 % % % % % % % % % % % file name =>...

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

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