|
|
Remco de Korte <rem### [at] xs4allnl> wrote:
: I know how to normalize a vector (as you describe), i _don't_ know hot
: to calculate VCROSS (I mistook it for caclulating the average).
: So, again: how to calculate a normal?
The cross-product of two vectors <x1,y1,z1> and <x2,y2,z2> can be
calculated this way:
| i j k |
| x1 y1 z1 | = (y1*z2-y2*z1)i + (x2*z1-x1*z2)j + (x1*y2-x2*y1)k
| x2 y2 z2 |
ie:
<y1*z2-y2*z1, x2*z1-x1*z2, x1*y2-x2*y1>
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|