Estoy usando x + (distance * Math.cos(orientation * Math.PI)) y y + (distance * Math.sin(orientation * Math.PI)) para calcular xx e yy respectivamente.
50 + (20 * Math.sin(1 * Math.PI)) y 50 + (20 * Math.cos(0.5 * Math.PI)) igual a 50
pero
50 + (20 * Math.sin(2 * Math.PI)) y 50 + (20 * Math.cos(1.5 * Math.PI)) igual 49.99999999999999 ?
Esperaba 50 aquí también. ¿Es una peculiaridad de javascript con la que necesito usar Math.ceil() (calculando coordenadas en un lienzo)?