Hello Pooria,

There is too much going on in your question and the notation used here is also ambiguous. Let me point out a few issues here

1) ||v|| and ||w|| denote magnitudes hence scalars so ||v||x||w|| (cross product) does not make any sense.

2) If we interpret them as a simple product, then all you are doing is arranging the Pairs array in ascending order of the product of magnitudes of the pairs in each element of the array.

I hope you meant case (2). In this case the dotProduct array should have all elements equal 0 as v and w are orthogonal hence v.w =0.

However since you have rounded the values and then have taken v.w the values will not exactly be zero but very close to zero due to cosθ.

Now there could be a chance that this array is as well sorted in the same order. Assuming that in each case 0 < cosθ <= k, where k is some real value. Since its just the magnitude that is effecting the sorting the order could be preserved as you have mentioned that there is a large variation in the magnitude values.

However if cosθ values are fluctuating say in the case like |cosθ| <= k where it taking some negative values also then we cannot argue that dotProduct is also arranged in the same way Pairs.

~Kalyan.