It might be a problem with the Math library not working the same way or problems with undefined angles.