fork download
  1. #include <stdio.h>
  2. #include <tgmath.h>
  3.  
  4. float my_Trig_LawOfCos_OppSideLength(float centerAngle, float sideA, float sideB)
  5. {
  6. float sideLengthPow2= pow(sideA,2) + pow(sideB,2)
  7. -(2*sideA*sideB)*cos(centerAngle*(3.14159/180));
  8. float sideLength = sqrt(sideLengthPow2);
  9. return sideLength;
  10. }
  11.  
  12. int main(void) {
  13. printf("%f", my_Trig_LawOfCos_OppSideLength(40.f, 23.1f, 19.f));
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 10320KB
stdin
Standard input is empty
stdout
14.905565