Sine Rule with Derivation , Example and Implementation | Java program for the above approach ; Function to calculate remaining two sides ; Calculate angle B ; Convert angles to their respective radians for using trigonometric functions ; Sine rule ; Print the answer ; Driver code ; Input ; Function Call
class GFG { static void findSides ( double A , double C , double c ) { double B = 180 - ( A + C ) ; A = A * ( 3.14159 / 180 ) ; C = C * ( 3.14159 / 180 ) ; B = B * ( 3.14159 / 180 ) ; double a = ( c / Math . sin ( C ) ) * Math . sin ( A ) ; double b = ( c / Math . sin ( C ) ) * Math . sin ( B ) ; System . out . println ( String . format ( " % .2f " , a ) ) ; System . out . println ( String . format ( " % .2f " , b ) ) ; } public static void main ( String [ ] args ) { double A = 45.0 ; double C = 35.0 ; double c = 23 ; findSides ( A , C , c ) ; } }