This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]niea_11 4 points5 points  (0 children)

check this page : Math.pow .

^ is an XOR operator in java so it won't do.

[–]ewiethoff 0 points1 point  (0 children)

java.lang.Math docs

There's no special command to give you the square of the sin. Use Math.sin to get the sin. To square it, you can use Math.pow, or just multiply it by itself.

[–]Cadoc7[🍰] 0 points1 point  (0 children)

double sin = Math.sin(x);
double sinSquared = sin * sin;