Getting inverse sinus in degrees in c++

Hi. I'm new to c++ but have programmed in java for a couple of months. I want
to make a program that calculates the refraction of Snell's law. Everthing
is fine but I can't inverse the sin (refraction) in degrees.
Is there possible way to do this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <cmath>
using namespace std;

void AskI(){
    cout << "Pleas Enter The Angle Of Incidence" << endl;
}

void AskN(){
    cout << "Pleas Enter The Refractive Index" << endl;
}

double Proces (double I ,double N){
double Index = N;
double DegreeI = sin(I*3.14159265359/180);
double DegreeSinR = DegreeI/Index;
double DegreeR = sinh (DegreeSinR???)         :How To get the inverse sinus in               
                                               degrees?
   cout<< DegreeR << endl;

}

int main(){
double a;
double b;

AskI();
cin >> a;

AskN();
cin >> b;

Proces(a,b);
return 0;
}
inverse sinus
Do you mean like 1/sin or arc sine?

for arc sine there is std::asin() function. As it returns value in radians, you should convert it to degrees after thst. like:
1
2
3
4
const double PI = 3.14159265358;
const double rad2deg = 180 / PI;
//...
double Degree = rad2deg * std::asin(value);
double DegreeR = sinh (DegreeSinR???)


'sinh' to me implies hyperbolic sine. I'm not sure why you'd need this at all to work out angle of refraction, which i'm assuming you're trying to do?

I vaguely remember snell's law is just
[ sin(theta1)/sin(theta2) ] / [ n2/n1 ]

isn't it?
Wel, the formula of snell's law is sini / sinr = n2 / n1
It doesn't work before you have the answer in degrees. In radians you can't
calculate it. But i tried MiiNiPaa's answer and it works perfectly now. thanks
Topic archived. No new replies allowed.