Can anyone give me a quick tip?
For example....how would I find the sine of 90 degrees?
sin() returns the trigonometry sine of an angle in between 0.0 and pi. If the argument is NaN or infinity, then the result is NaN. If the argument is zero, then the result is a zero with the same sign as the argument.
sin^2(value) in maths is equal to Java Math. sin(value) * Math. sin(value), which can be simplified by making Math. sin(value) a variable and use it instead of computing the sin two times.
sin() method does. Yes, you convert your degrees value into a radians value first.
cos(double a) returns the trigonometric cosine of an angle. If the argument is NaN or an infinity, then the result is NaN. The computed result must be within 1 ulp of the exact result.
The sin function in java.lang.Math expects a parameter expressed in radians.
I think you should use Math.sin(Math.toRadians(90))
You could use the Math.sin function where the argument is given in radians. Example:
double result = Math.sin(Math.PI / 2.0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With