I am doing a calculation to obtain a value in degrees, but I have found that the result of an operation in JavaScript , where the types of trigonometric operations intervene, throws these values in radians.
Formula
23.45 * sin(360 * ((284 + dn)/365))
Then I perform in JavaScript as follows:
var miVariable = 23.45 * Math.sin(360 * ((284 + 196)/365));
console.log(miVariable);
The value thrown is 19.15 , of course, rounding off the final value.
The problem is that JavaScript gives the result in radians, and I want it in degrees. I searched, and the solution they give is, multiply the result in radians in the following way:
miVariable * (180/Math.PI);
... but the value thrown is 1097.2141776755263
Similarly, if I multiply the result but only the calculation of the sine operation, it falls within a possible range of -360 and 360 .
var valorSeno = Math.sin(360 * ((284 + 196)/365));
var valorFinal = valorSeno * (180/Math.PI);
console.log(valorFinal);
Similarly, here I still do not multiply by the value 23.45 , since it throws, the same value at the end.
The final value I need is 21.51