[Gridflow-dev] geometry, cross products, matrix inversions...
matju at artengine.ca
Sat Nov 19 16:41:57 EST 2011
Le 2011-11-19 à 21:57:00, mescalinum at gmail.com a écrit :
> attached is an attempt of doing cross product by computing the skew
> (pre-cross-product) matrix of left operand, and then doing a matrix
> multiplication with the right operand.
> it involves a 3x3 times 3x1 inner product, but requires some #pack/#unpack
> would you do it in some alternative way?
I just added examples/cross_product.pd in the svn :
But neither implementation supports doing many of them at once, so, they
can't be efficient at all.
> also, what about computing the adjoint of a matrix?
>  http://en.wikipedia.org/wiki/Adjugate_matrix
That's even harder, I think.
But for each of those products, there could be a GridFlow external that
would be efficient, and it wouldn't be hard for you to write (if I answer
your questions about how to do that).
I mean the 3-d cross-product and the 3-d adjoint. In 3-d, adjoints are
products because they are made by summing parts that are products. A
2-dimensional determinant is also a kind of product because the
determinant of (2 2 # $1 $2 $3 $4 ) is $1*$4-$2*$3 which is a sum (or
difference) of products. The 2-dimensional determinant is the base pattern
of both the 3-d cross and the 3-d adjoint.
And I agree (in answer to your chat) that solutions involving 3x3x3
matrices and 9x9x9 matrices and such are quite overkill. Thus externals
would be welcome.
There might be more efficient ways to do it in GF then just using [#inner]
twice, though, but they're not necessarily any nicer to look at, and
probably lots faster than [#inner] twice, while still being much slower
than a C++ external.
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
More information about the Gridflow-dev