Sine Rule with Derivation , Example and Implementation | C ++ 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 ; Precision of 2 decimal spaces ; Print the answer ; Driver Code ; Input ; Function Call
#include <bits/stdc++.h> NEW_LINE using namespace std ; 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 / sin ( C ) ) * sin ( A ) ; double b = ( c / sin ( C ) ) * sin ( B ) ; cout << fixed << setprecision ( 2 ) ; cout << a << endl ; cout << b << endl ; } int main ( ) { double A = 45.0 ; double C = 35.0 ; double c = 23 ; findSides ( A , C , c ) ; return 0 ; }