POV-Ray : Newsgroups : povray.advanced-users : Matrix question : Re: Matrix question Server Time
4 May 2024 21:26:57 EDT (-0400)
  Re: Matrix question  
From: Francois Labreque
Date: 21 Dec 2000 18:08:41
Message: <3A428CA3.D5E323E7@videotron.ca>
Rune wrote:
> 
> I have a matrix A. Then I transform it by the matrix B. The result is Matrix
> C. Given A and C, how do I find B ?

[A][B] = [C]

Premultiply both sides by the inverse of [A]

[A-1][A][B] = [A-1][C]

a matrix times its inverse is the indentity matrix, hence

[1][B] = [A-1][C]

any matrix times the identity matrix is the matrix itself, hence

[B] = [A-1][C]

Q.E.D.

However, this only works for square matrices (if my math isn't too
rusty).

> 
> Instead of matrixes the input and output should be sets of 4 vectors each.
> 
> I imagine a macro like this:
> 
> FindMatrix (Ax,Ay,Az,Ap,Cx,Cy,Cz,Cp)
> 
> It would #declare the vectors Bx, By, Bz and Bp

The macro coding is left to the student as an exercice. :)

-- 
Francois Labreque | Rimmer: "Let's go to red alert!"
    flabreque     | Kryten: "Are you sure, Sir?  You realize it
        @         |          actually means changing the bulb!"
   videotron.ca


Post a reply to this message

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