[Gridflow-dev] geometry, cross products, matrix inversions...

Claude Heiland-Allen claude at goto10.org
Sat Nov 26 20:48:41 EST 2011


On 24/11/11 22:41, mescalinum at gmail.com wrote:
> Il 24/11/2011 23:10, mescalinum at gmail.com ha scritto:
>> Il 21/11/2011 09:07, Mathieu Bouchard ha scritto:
>>> Le 2011-11-19 à 22:32:00, mescalinum at gmail.com a écrit :
>>>
>>>> it involves a 3x3 times 3x1 inner product, but requires some
>>>> #pack/#unpack trickery. would you do it in some alternative way?
>>>
>>> use [# cross], added 2 minutes ago. Should be much faster than any of
>>> my 3 first solutions.
>>>
>>>> also, what about computing the adjoint[1] of a matrix?
>>>> [1] http://en.wikipedia.org/wiki/Adjugate_matrix
>>>
>>> a fast way would use [# cross] preceded by some amount of preparation.
>>> Using two 3x3 matrices, [# cross] will do 3 cross products.
>>>
>>> [#store] allows to easily select rows from a matrix (but not
>>> columns). You just give it a column-matrix of indices (3 1 # ...).
>>>
>>> Post your patch when you're done. :)
>>
>> could be an example of using [# cross] (other than [# cross] used for
>> doing cross products!)
>
> actually there was an error in the patch.
> I corrected it; I also added a little proof, that is: A*adj(A) is always
> equal to det(A)*I for every A

This mention of det reminds me that something I needed recently was 
determinants of 3x3 complex matrices for computing a Moebius 
transformation between two triples of points:

http://en.wikipedia.org/wiki/Moebius_transformation#Explicit_determinant_formula

My C++ code also uses sqrt(complex) to convert to the (k,g1,g2) form, 
and pow(complex, double) for animation:

http://en.wikipedia.org/wiki/Moebius_transformation#Determining_the_fixed_points 
(g1,g2)
http://en.wikipedia.org/wiki/Moebius_transformation#Poles_of_the_transformation 
(k)
http://en.wikipedia.org/wiki/Moebius_transformation#Iterating_a_transformation 
(n in R)


Claude



More information about the Gridflow-dev mailing list