11.08.2016, 15:21
This will print those that are near each other, while removing the data if not valid, then you should go basically tape those datas into another array.
You can re-write this to write the data for you in a clean file, but I'm only here to provide a way, it's up to you to improve it.
#define FLOAT_INFINITY (Float:0x7F800000)
Here's the infinity if you don't have it defined.
You can re-write this to write the data for you in a clean file, but I'm only here to provide a way, it's up to you to improve it.
PHP код:
for(new i;i<100;i++)
{
new done;
for(new j;j<i;j++) if(SomeArray[j][0]!=FLOAT_INFINITY&&VectorSize(floatabs(SomeArray[i][0]-SomeArray[j][0]),floatabs(SomeArray[i][1]-SomeArray[j][1]),floatabs(SomeArray[i][2]-SomeArray[j][2]))<15.0)
{
print("{%f,%f,%f},",SomeArray[i][0],SomeArray[i][1],SomeArray[i][2]);
done=1;
break;
}
if(!done) SomeArray[i][0]=SomeArray[i][1]=SomeArray[i][2]=FLOAT_INFINITY;
}
Here's the infinity if you don't have it defined.