The documentation of asin should be just enoough: '(it) Computes the principal value of the arc sine of arg'
That is you get the first quadrant angle correnspondig to the sin value passed as argument.
The following program
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
const size_t N = 18;
const double delta = M_PI/N;
for ( double phi = 0; phi < 2*M_PI; phi += delta)
{
double s = sin(phi);
double a = asin(s);
cout << "phi = " << phi << ", sin(phi) = " << s << ", asin(sin(phi)) = " << a << "\n";
}
cout << endl;
}
outputs
phi = 0, sin(phi) = 0, asin(sin(phi)) = 0
phi = 0.174533, sin(phi) = 0.173648, asin(sin(phi)) = 0.174533
phi = 0.349066, sin(phi) = 0.34202, asin(sin(phi)) = 0.349066
phi = 0.523599, sin(phi) = 0.5, asin(sin(phi)) = 0.523599
phi = 0.698132, sin(phi) = 0.642788, asin(sin(phi)) = 0.698132
phi = 0.872665, sin(phi) = 0.766044, asin(sin(phi)) = 0.872665
phi = 1.0472, sin(phi) = 0.866025, asin(sin(phi)) = 1.0472
phi = 1.22173, sin(phi) = 0.939693, asin(sin(phi)) = 1.22173
phi = 1.39626, sin(phi) = 0.984808, asin(sin(phi)) = 1.39626
phi = 1.5708, sin(phi) = 1, asin(sin(phi)) = 1.5708
phi = 1.74533, sin(phi) = 0.984808, asin(sin(phi)) = 1.39626
phi = 1.91986, sin(phi) = 0.939693, asin(sin(phi)) = 1.22173
phi = 2.0944, sin(phi) = 0.866025, asin(sin(phi)) = 1.0472
phi = 2.26893, sin(phi) = 0.766044, asin(sin(phi)) = 0.872665
phi = 2.44346, sin(phi) = 0.642788, asin(sin(phi)) = 0.698132
phi = 2.61799, sin(phi) = 0.5, asin(sin(phi)) = 0.523599
phi = 2.79253, sin(phi) = 0.34202, asin(sin(phi)) = 0.349066
phi = 2.96706, sin(phi) = 0.173648, asin(sin(phi)) = 0.174533
phi = 3.14159, sin(phi) = 1.45473e-15, asin(sin(phi)) = 1.45473e-15
phi = 3.31613, sin(phi) = -0.173648, asin(sin(phi)) = -0.174533
phi = 3.49066, sin(phi) = -0.34202, asin(sin(phi)) = -0.349066
phi = 3.66519, sin(phi) = -0.5, asin(sin(phi)) = -0.523599
phi = 3.83972, sin(phi) = -0.642788, asin(sin(phi)) = -0.698132
phi = 4.01426, sin(phi) = -0.766044, asin(sin(phi)) = -0.872665
phi = 4.18879, sin(phi) = -0.866025, asin(sin(phi)) = -1.0472
phi = 4.36332, sin(phi) = -0.939693, asin(sin(phi)) = -1.22173
phi = 4.53786, sin(phi) = -0.984808, asin(sin(phi)) = -1.39626
phi = 4.71239, sin(phi) = -1, asin(sin(phi)) = -1.5708
phi = 4.88692, sin(phi) = -0.984808, asin(sin(phi)) = -1.39626
phi = 5.06145, sin(phi) = -0.939693, asin(sin(phi)) = -1.22173
phi = 5.23599, sin(phi) = -0.866025, asin(sin(phi)) = -1.0472
phi = 5.41052, sin(phi) = -0.766044, asin(sin(phi)) = -0.872665
phi = 5.58505, sin(phi) = -0.642788, asin(sin(phi)) = -0.698132
phi = 5.75959, sin(phi) = -0.5, asin(sin(phi)) = -0.523599
phi = 5.93412, sin(phi) = -0.34202, asin(sin(phi)) = -0.349066
phi = 6.10865, sin(phi) = -0.173648, asin(sin(phi)) = -0.174533
phi = 6.28319, sin(phi) = -4.68582e-15, asin(sin(phi)) = -4.68582e-15
|