Java: Calc x in sin (x)
My question is about angle functions in Java languge programming. if i want to get sin of any double i just use
double variable = Math.sin(x);
but what if sin (x) = 0.324 (or any other random number) and I want to calculate x? How should I do it? Is there any native function for this in java or should I implement my own algorithm to get this value back?
getXForValue(0.324);
public double getXForValue(double val){
// how to calculate ?
return x;
}
Thank.
+3
source to share
6 answers
+10
source to share
You can use Math.asin(0.324);
to get x value.
Read the Math.asin () javadoc to know what the function returns.
0
user973999
source
to share