10-17-2024, 03:47 AM
It's not that the math is wrong...I think you're just misinterpreting the docs.
You are correct, the math is basically:
And as the docs say:
Which doesn't imply that the distance between resampled particles will be equal to the threshold, only that a resampled particle will be added if the distance between two particles is at least as great as the threshold.
So take an example of 2 particles spaced 10 units apart with a resample threshold of 10. A single particle would be created (10/10 = 1) between them (as per the docs), whose distance from either originating particle would be 5 units.
Similarly, 2 particles spaced 60 units apart with a threshold of 20 will generate 3 particles (60/20 = 3), despite the fact that the distance between those resampled particles will be 15 as you pointed out.
So basically the assumption that the threshold is the distance between resampled particles is incorrect - it's instead the minimum distance required between 2 particles before they will generate new resampled particles between them.
You are correct, the math is basically:
Code:
numNewParticles = distBetweenParticles / threshold
And as the docs say:
Code:
the minimum distance required between two particle pairs before resampling will occur.
Which doesn't imply that the distance between resampled particles will be equal to the threshold, only that a resampled particle will be added if the distance between two particles is at least as great as the threshold.
So take an example of 2 particles spaced 10 units apart with a resample threshold of 10. A single particle would be created (10/10 = 1) between them (as per the docs), whose distance from either originating particle would be 5 units.
Similarly, 2 particles spaced 60 units apart with a threshold of 20 will generate 3 particles (60/20 = 3), despite the fact that the distance between those resampled particles will be 15 as you pointed out.
So basically the assumption that the threshold is the distance between resampled particles is incorrect - it's instead the minimum distance required between 2 particles before they will generate new resampled particles between them.