|
 |
Invisible a écrit :
>>> All these years, I thought the correct way to compute the cross
>>> product of two vectors is
>>>
>>> x3 = y1 z2 - z1 y2
>>> y3 = x1 z2 - z1 x2
>>> z3 = x1 y2 - y1 x2
>>>
>>> But, apparently, I was wrong. The correct way is in fact
>>>
>>> x3 = y1 z2 - z1 y2
>>> y3 = z1 x2 - x1 z2
>>> z3 = x1 y2 - y1 x2
>>>
>>
>> You should have caught that based on symmetry.
>
> Well, the rule seems clear: the expression for (say) Y involves every
> coordinate except Y itself. I never realised it actually matters which
> order you put them in...
My rule is rather a rotation (X->Y->Z->X) and yes, order matter.
You can write the first line as you want, but for the next lines, the
rotation must be applied on it strictly.
Basic check: X.Y gives Z, Y.Z gives X, Z.X gives Y, it's always a XYZ
sequence in loop. (X Y Z X Y Z...)
--
Real software engineers work from 9 to 5, because that is<br/>
the way the job is described in the formal spec. Working<br/>
late would feel like using an undocumented external procedure.
Post a reply to this message
|
 |