Hypotenuse for ONE side and ONE angle?

On a right angled triangle, if the user inputs only ONE side length (not the hypotenuse) and only ONE angle, what code is required to work out the hypotenuse? I know how to work out the final side and the remaining angle once I have this.

Thank you in advance
It depend on which side: opposite of adjanced to the angle. If it is oppsosite, you need to divide side by sine of the angle, otherwise you need to divide side by cosine
could you give me an example of this in code please? I've been trying to divide my side by the sine of the angle but it doesn't appear to be correct. My code is below.

Side_c = Side_a / sin(Angle_b);
1
2
3
4
5
6
7
8
9
10
11
12
13
#include<iostream>
#include<cmath>

int main ()
{
    const double Pi = std::acos(-1);
    const double side_a = 4.0; 
    const double angle_a = Pi / 3.0; //Adjanced angle
    const double angle_b = Pi / 6.0; //opposite angle is 30°, so it is half of hypot
    double hypot1 = side_a / std::sin(angle_b); //Make sure that both calculation methods
    double hypot2 = side_a / std::cos(angle_a); //give the same result
    std::cout << hypot1 << '\n' << hypot2;
}
8
8
MiiNiPaa,
Thank you for your time btw :)
Topic archived. No new replies allowed.