[Gridflow-dev] geometry, cross products, matrix inversions...
Mathieu Bouchard
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
> trickery.
>
> would you do it in some alternative way?
I just added examples/cross_product.pd in the svn :
http://gridflow.ca/svn/trunk/examples/cross_product.pd
But neither implementation supports doing many of them at once, so, they
can't be efficient at all.
> also, what about computing the adjoint[1] of a matrix?
> [1] 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.
(right ?)
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
mailing list