Math.cos() gives wrong result
Math.cos()
expects the parameter to be in radians. This will return the result you need:
Math.cos(Math.toRadians(50));
Degrees <> radians...........
Math.cos()
uses radians, so to get your expected result you need to do
System.out.println(Math.cos(Math.toRadians(50)));