Check for numerically similar values

I have the following code:


objArray = [main.navHead1, main.navHead2, main.navHead3];
for (q=0; q<objArray.length; q++) {
    objArray[q].a = Math.random()*800;
    objArray[q].b = Math.random()*wVar;
    objArray[q].c = Math.random()*hVar;
}

I need to figure out a way to make it so that if any of the values are too close (say, within 50 of each other) it adds a fixed amount to one of the values so that they are no longer that near to each other.

I’m stumped. Any ideas?