Length of remaining two sides of a Triangle from a given side and its adjacent angles | Function for computing other 2 side of the trianlgle ; Computing angle C ; Converting A in to radian ; Converting B in to radian ; Converting C in to radian ; Computing length of side b ; Computing length of side c ; Driver code ; Calling function
function findSide ( a , B , C ) { var A = 180 - C - B ; var radA = Math . PI * ( A / 180 ) ; var radB = Math . PI * ( B / 180 ) ; var radC = Math . PI * ( C / 180 ) ; var b = a / Math . sin ( radA ) * Math . sin ( radB ) ; var c = a / Math . sin ( radA ) * Math . sin ( radC ) ; document . write ( b + " " ) ; document . write ( c ) ; } var a = 12 , B = 60 , C = 30 ; findSide ( a , B , C ) ;