Java: Calc x in sin(x)

java, math, trigonometry

Solution

What you are describing is known as the "arcsine" function. It's available in Java as Math.asin().

You may want to read the wiki on trigonometric functions.

Problem

My question is about angle functions in programming languge Java. 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 can i do it? Are there any native function to this in java or i have to implement my own algorithm to return this value ? ``` getXForValue(0.324); public double getXForValue(double val){ // how to calculate ? return x; } ``` Thanks.

Original source