POV-Ray : Newsgroups : povray.advanced-users : Matrix help needed Server Time
24 Dec 2024 12:55:59 EST (-0500)
  Matrix help needed (Message 1 to 4 of 4)  
From: Josh English
Subject: Matrix help needed
Date: 14 Jul 2000 14:22:42
Message: <396F5AC8.4DD0F92D@spiritone.com>
Not the matrix keyword, I know about John VanSickle's page... what I
can't seem to find is a method of finding an inverse of a 4 by 4 matrix.
The goal is to create a linear map from one 3d vector space to another,
one that is non-orthogonal and doen'st necessarily have the same center
as the normal POV-Ray coordinate system. If I define the new coordinate
space with three direction vectors and a center, giving me a 3 by 4
matrix (and add a fourth column in the same manner that POV-Ray does) I
want to convert any point in the normal space to be represented in the
new vector space.

The goal is to create boxes that are scaled and rotated and skewed, and
then to see if a point interesects the box.

Thanks for any help,

Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/

(PS, Yes, I know about trace, I don't like using it becasue I feel like
it's cheating in a way.)


Post a reply to this message

From: ryan constantine
Subject: Re: Matrix help needed
Date: 14 Jul 2000 18:00:07
Message: <396F8D12.297162E7@yahoo.com>
the inverse for any n by n matrix is as follows:

given matrix A, the inverse, A^(-1) is
(1/detA)*(Cij)^T 
where i and j are subscripts denoting matrix row and column,
det stands for determinate,
T stands for transpose,
Cij=(-1)^(i+j)*Mij,
Mij is the determinate of the (n-1) by (n-1) matrix formed by deleting
the ith row and jth column from A.

so in other words, given a 4 by 4 matrix:
   ( a11 a12 a13 a14 )
  (  a21 a22 a23 a24  )
A=(  a31 a32 a33 a34  )
   ( a41 a42 a43 a44 )

A^(-1)=(1/detA)* ( C11 C21 C31 C41 )
                (  C12 C22 C32 C42  )
                (  C13 C23 C33 C43  )
                 ( C14 C24 C34 C44 ) where C11,31,22,42,13,33,24,and 44
are positive and the rest are negative.

example of C11 (cross out row 1 and column 1):
        
       (a22 a23 a24)
C11=det(a32 a33 a34)
       (a42 a43 a44)
repeat this step for all C.


Post a reply to this message

From: Josh English
Subject: Re: Matrix help needed
Date: 14 Jul 2000 19:04:32
Message: <396F9CC3.169A11A5@spiritone.com>
Thanks. I'll start coding that. What I can easily see is a way for
transforming POV 3-space into my own three space, but for what I need to
do, I need to convert back from my old three space into POV three space.

Josh
ryan constantine wrote:

> the inverse for any n by n matrix is as follows:
>
> given matrix A, the inverse, A^(-1) is
> (1/detA)*(Cij)^T
> where i and j are subscripts denoting matrix row and column,
> det stands for determinate,
> T stands for transpose,
> Cij=(-1)^(i+j)*Mij,
> Mij is the determinate of the (n-1) by (n-1) matrix formed by deleting
> the ith row and jth column from A.
>
> so in other words, given a 4 by 4 matrix:
>    ( a11 a12 a13 a14 )
>   (  a21 a22 a23 a24  )
> A=(  a31 a32 a33 a34  )
>    ( a41 a42 a43 a44 )
>
> A^(-1)=(1/detA)* ( C11 C21 C31 C41 )
>                 (  C12 C22 C32 C42  )
>                 (  C13 C23 C33 C43  )
>                  ( C14 C24 C34 C44 ) where C11,31,22,42,13,33,24,and 44
> are positive and the rest are negative.
>
> example of C11 (cross out row 1 and column 1):
>
>        (a22 a23 a24)
> C11=det(a32 a33 a34)
>        (a42 a43 a44)
> repeat this step for all C.

--
Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/


Post a reply to this message

From: Warp
Subject: Re: Matrix help needed
Date: 17 Jul 2000 10:38:51
Message: <39731a7a@news.povray.org>
Just for curiosity: Inverting a matrix (specially if it's very big) is a
very expensive process (expensive in time). I think that inversion of huge
matrices is used as one test with supercomputers to test their speed.
  So it's not very simple... :)

-- 
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.