Skip to content

Commit

Permalink
Merge pull request #653 from Vince0789/Vince0789-patch-1
Browse files Browse the repository at this point in the history
y_utils_random: fix reference variables
  • Loading branch information
Y-Less authored Oct 9, 2023
2 parents 1be9840 + c2f4d4b commit 885d03e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions YSI_Core/y_utils/y_utils_random.inc
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ stock RandomPointsInCircleDistributed(Float:centreX, Float:centreY, Float:radius
for (sx = 0; sx != sy; ++sx)
{
randA = RandomFloat(360.0);
randD = radius * floatsqrt(RandomFloat(1.0));
randD = radius * floatsqroot(RandomFloat(1.0));
xs[sx] = randD * floatsin(randA, degrees) + centreX;
ys[sx] = randD * floatsin(randA, degrees) + centreY;
}
Expand All @@ -658,7 +658,7 @@ stock RandomPointsInCircleDistributed(Float:centreX, Float:centreY, Float:radius
* </remarks>
*//*------------------------------------------------------------------------**/

stock RandomPointInCircleSampled(Float:centreX, Float:centreY, Float:radius, Float:outX, Float:outY)
stock RandomPointInCircleSampled(Float:centreX, Float:centreY, Float:radius, &Float:outX, &Float:outY)
{
new Float:minX = centreX - radius, Float:minY = centreY - radius;
new Float:maxX = centreX + radius, Float:maxY = centreY + radius;
Expand Down Expand Up @@ -690,7 +690,7 @@ stock RandomPointInCircleSampled(Float:centreX, Float:centreY, Float:radius, Flo
* </remarks>
*//*------------------------------------------------------------------------**/

stock RandomPointInCircleCentred(Float:centreX, Float:centreY, Float:radius, Float:outX, Float:outY)
stock RandomPointInCircleCentred(Float:centreX, Float:centreY, Float:radius, &Float:outX, &Float:outY)
{
new Float:randA = RandomFloat(360.0);
new Float:randD = RandomFloat(radius);
Expand All @@ -714,10 +714,10 @@ stock RandomPointInCircleCentred(Float:centreX, Float:centreY, Float:radius, Flo
* </remarks>
*//*------------------------------------------------------------------------**/

stock RandomPointInCircleDistributed(Float:centreX, Float:centreY, Float:radius, Float:outX, Float:outY)
stock RandomPointInCircleDistributed(Float:centreX, Float:centreY, Float:radius, &Float:outX, &Float:outY)
{
new Float:randA = RandomFloat(360.0);
new Float:randD = radius * floatsqrt(RandomFloat(1.0));
new Float:randD = radius * floatsqroot(RandomFloat(1.0));
outX = randD * floatsin(randA, degrees) + centreX;
outY = randD * floatsin(randA, degrees) + centreY;
}
Expand Down

0 comments on commit 885d03e

Please sign in to comment.