Math.cos() gives wrong result August 4, 2023 by Tarik Math.cos() expects the parameter to be in radians. This will return the result you need: Math.cos(Math.toRadians(50));