I’m trying to write a spraypaint type program but I have forgotten all my maths.
I need some sort of probability equation to pick pixels near where the user clicks. So the probability should be high near the center and then decrease as the distance from the center gets higher and once you reach a certain distance the probability should be zero.
Also the probability at the center should be a smooth curve (if you know what I mean)
I’m not sure which language you’re coding in, so here’s some pseudo-code. I will assume you know the corresponding syntax in the language you’re coding in.
The basic idea is: