ps3solnsF06

# ps3solnsF06 - %Engineering 6 Fall 2006 Problem 3.1...

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

%(Triangle problem) %Suppress extra lines in output and clear command window and variables format compact ; clc; clear; %Note: There are several ways to solve this problem. We use % the law of cosines below. %Initialize variables (sides of triangle, angles b and c in radians) sideDE = 24; sideEF = 13; b_degs = 38; %We only need b in degrees for the calculations below c_rads = 48*pi/180; %Use law of cosines to find the length DF sideDF = sqrt(sideEF^2 + sideDE^2 - 2*sideEF*sideDE*cos(c_rads)); %Use DF, the law of cosines, and the acos function to find %the angle a in degrees a_degs = 180/pi*acos((sideEF^2 - sideDE^2 - sideDF^2)/(-2*sideDE*sideDF)); %Calculate angle d in degrees(where a+d+(180-b)=180, or d=b-a) d_degs = b_degs - a_degs; %Display results fprintf( 'For the given triangle:\n' ); fprintf( 'The length DF is %.1f meters.\n' ,sideDF); fprintf( 'The angle a is %.1f degrees.\n' ,a_degs); fprintf( 'The angle d is %.1f degrees.\n' ,d_degs); Displayed results: For the given triangle: The length DF is 18.1 meters. The angle a is 32.3 degrees.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/22/2011 for the course ENG 006 taught by Professor Lagerstrom during the Fall '06 term at UC Davis.

### Page1 / 5

ps3solnsF06 - %Engineering 6 Fall 2006 Problem 3.1...

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

View Full Document
Ask a homework question - tutors are online