Length of remaining two sides of a Triangle from a given side and its adjacent angles | Java program for above approach ; 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
import java . util . * ; class GFG { static void findSide ( double a , double B , double C ) { double A = 180 - C - B ; double radA = ( Math . PI * ( A / 180 ) ) ; double radB = ( Math . PI * ( B / 180 ) ) ; double radC = ( Math . PI * ( C / 180 ) ) ; double b = ( a / Math . sin ( radA ) * Math . sin ( radB ) ) ; double c = ( a / Math . sin ( radA ) * Math . sin ( radC ) ) ; System . out . printf ( " % .15f " , b ) ; System . out . printf ( " ▁ % .15f " , c ) ; } public static void main ( String [ ] args ) { int a = 12 , B = 60 , C = 30 ; findSide ( a , B , C ) ; } }