Length of remaining two sides of a Triangle from a given side and its adjacent angles | C ++ 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
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findSide ( float a , float B , float C ) { float A = 180 - C - B ; float radA = M_PI * ( A / 180 ) ; float radB = M_PI * ( B / 180 ) ; float radC = M_PI * ( C / 180 ) ; float b = a / sin ( radA ) * sin ( radB ) ; float c = a / sin ( radA ) * sin ( radC ) ; cout << fixed << setprecision ( 15 ) << b << " ▁ " ; cout << fixed << setprecision ( 15 ) << c ; } int main ( ) { int a = 12 , B = 60 , C = 30 ; findSide ( a , B , C ) ; }