java – Math. Invalid cos

This point of my program should use the cosine rule to calculate bottomangle

public double bottomAngle() {

        topAngleinradians = Math.toradians(topAngle) ;

        return (Math.cos(topAngleinradians)(bottomAngle() = ladderLength^2 + floorLength^2 - verticalHeight^2) / 2 * ladderLength * floorLength) ;
        }

Error generated:

This is my error list. I can't figure out what's wrong with my formula All methods such as verticalheight and ladderlength work well in other methods I got the formula wrong Can you help me?

Solution

If you do not see the error list, a syntax error occurs:

return(Math.cos(topAngleinradians)(bottomAngle()= ladderLength ^ 2 floorLength ^ 2 – verticalHeight ^ 2)/ 2 * ladderLength * floorLength);

>What do you think of math There is no operator between the call to cos() and the next part of the expression. > It seems that you are also assigning values to function calls, which makes no sense. >^ The operator is not an exponential operator, but a bitwise exclusive or operator You may be looking for math pow().

These are the tops I see It may be helpful to read about Java operators and how they are evaluated

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>