You are on page 1of 1

C C C C

This program finds triangle angles opposite given sides (exercise 2.9.13). prompt for and read the side lengths PRINT *,sides: READ *,SA,SB,SC use law of cosines to find the angles CA=(SB**2 + SC**2 - SA**2)/(2.*SB*SC) A=ACOS(CA) CB=(SA**2 + SC**2 - SB**2)/(2.*SA*SC) B=ACOS(CB) CC=(SA**2 + SB**2 - SC**2)/(2.*SA*SB) C=ACOS(CC) convert angles to degrees for output PI=4.*ATAN(1.) DPR=180./PI A=DPR*A B=DPR*B C=DPR*C PRINT *,opposite angles: PRINT *,A,B,C STOP END

C C

02

03

C C

You might also like