Apply uniform distribution with location jiggle #3

Manually merged
hloth merged 1 commit from smiludon/grindr-always-online:smiludon-patch-1 into main 2026-07-14 00:18:20 +02:00
Contributor

The code calculates distance using a uniform linear distribution:
let distance = rand::random_range(0.0..=max_meters);

Because the area of a circle scales with the square of the radius, picking a random radius linearly results in a heavy concentration of points near the center origin. If an algorithm analyzes the cluster of requests, the spatial distribution will look like a highly artificial bullseye rather than realistic human drift.To achieve a uniform distribution across the 5 meter radius disk, the distance calculation must use the square root of a random float between 0 and 1:

let distance = max_meters * rand::random_range(0.0..=1.0_f64).sqrt();

The code calculates distance using a uniform linear distribution: `let distance = rand::random_range(0.0..=max_meters);` Because the area of a circle scales with the square of the radius, picking a random radius linearly results in a heavy concentration of points near the center origin. If an algorithm analyzes the cluster of requests, the spatial distribution will look like a highly artificial bullseye rather than realistic human drift.To achieve a uniform distribution across the 5 meter radius disk, the distance calculation must use the square root of a random float between 0 and 1: `let distance = max_meters * rand::random_range(0.0..=1.0_f64).sqrt();`
The code calculates distance using a uniform linear distribution:
`let distance = rand::random_range(0.0..=max_meters);`

Because the area of a circle scales with the square of the radius, picking a random radius linearly results in a heavy concentration of points near the center origin. If an algorithm analyzes the cluster of requests, the spatial distribution will look like a highly artificial bullseye rather than realistic human drift.To achieve a uniform distribution across the 5 meter radius disk, the distance calculation must use the square root of a random float between 0 and 1:

`let distance = max_meters * rand::random_range(0.0..=1.0_f64).sqrt();`
hloth manually merged commit 84636b76da into main 2026-07-14 00:18:20 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hloth/grindr-always-online!3
No description provided.