This bit of my program is supposed to calculate bottomAngle using cosine rule.
public double bottomAngle() {
topAngleinRadians = Math.toRadians(topAngle) ;
return (Math.cos(topAngleinRadians)(bottomAngle() = ladderLength^2 + floorLength^2 - verticalHeight^2) / 2 * ladderLength * floorLength) ;
}
Errors produced:

Here is my list of errors and I can’t figure it out what’s wrong with my formula. All the methods such verticalHeight , ladderLength works perfectly fine in other methods. There is something wrong with the way I put this formula. Can you please help me out?
Without seeing your list of errors, you do have syntax errors:
return (Math.cos(topAngleinRadians)(bottomAngle() = ladderLength^2 + floorLength^2 - verticalHeight^2) / 2 * ladderLength * floorLength);Math.cos()and the next part of your expression.^operator is also not the exponential operator, but a bitwise exclusive OR operator. You’re probably looking forMath.pow().Those are just what I’m seeing right off the top. It might be helpful to read up about the Java operators and how they are evaluated.