Updated YAGSL to remove misconception of IEEERemainder

This commit is contained in:
thenetworkgrinch
2023-02-27 21:59:12 -06:00
parent ef58f545df
commit 9b78c6363f
117 changed files with 137 additions and 161 deletions

View File

@@ -31,7 +31,7 @@ public class PhysicsSim
/* scales a random domain of [0, 2pi] to [min, max] while prioritizing the peaks */
static double random(double min, double max)
{
return (max - min) / 2 * Math.sin(Math.IEEEremainder(Math.random(), 2 * 3.14159))
return (max - min) / 2 * Math.sin((Math.random() % 2 * Math.PI))
+ (max + min) / 2;
}