Javascript\'s MATH object has a random method that returns from the set [0,1) 0 inclusive, 1 exclusive. Is there a way to return a truly random method that includes 1.
The solution I found was to use trigonometric equations.
Because sine oscillates from Math.sin(0) = 0 and Math.sin(90) = 1. This repeats until 360 degrees which is equal to 0. However, 360 is still not highly precise so use radians which is 2 * Math.PI. You only need to take the absolute value to get rid of the negative values.
So,
double angle = 2 * Math.PI * Math.random()
double inclusive = Math.abs(Math.sin(angle)) // Math.cos(angle) also works.