Ok Im having a problem with getting the value for deltaY below. deltaX works (90-270 = -180 convert that to radians to get -PI, cos(-PI) = -1.0).
Now deltaY should be 0 (sin (-PI) = 0) but i get -1.2246467991473532E-16 in java???
Did i miss something? My calculator gives me 0.
heading value is between 0 - 359, its represnets the direction in degrees with 0=north, 90 = east, 180=south, 270=west. This is the start of a 2D Car game.
Question
Doli
Ok Im having a problem with getting the value for deltaY below. deltaX works (90-270 = -180 convert that to radians to get -PI, cos(-PI) = -1.0).
Now deltaY should be 0 (sin (-PI) = 0) but i get -1.2246467991473532E-16 in java???
Did i miss something? My calculator gives me 0.
heading value is between 0 - 359, its represnets the direction in degrees with 0=north, 90 = east, 180=south, 270=west. This is the start of a 2D Car game.
Math.sin and cos input values are in radians.
degree to radians = (deg x PI)/180.
Link to comment
https://www.neowin.net/forum/topic/622071-java-mathcos-and-mathsin/Share on other sites
2 answers to this question
Recommended Posts