Commit 88dba93a authored by Ken Martin's avatar Ken Martin
Browse files

Added transpose method

parent d6d2ba50
......@@ -33,6 +33,11 @@ class vlMatrix4x4 : public vlObject
void Invert (vlMatrix4x4 in,vlMatrix4x4 & out);
void Invert (void) { Invert(*this,*this);};
// Calculate the transpose of in and
// return it in out.
void Transpose (vlMatrix4x4 in,vlMatrix4x4 & out);
void Transpose (void) { Transpose(*this,*this);};
void VectorMultiply(float in[4], float out[4]);
void Adjoint (vlMatrix4x4 & in,vlMatrix4x4 & out);
float Determinant (vlMatrix4x4 & in);
......
......@@ -252,3 +252,17 @@ void vlMatrix4x4::PrintSelf (ostream& os, vlIndent indent)
}
}
void vlMatrix4x4::Transpose (vlMatrix4x4 in,vlMatrix4x4 & out)
{
int i, j;
float temp;
for (i=0; i<4; i++)
for(j=i; j<4; j++)
{
temp = in.Element[i][j];
out.Element[i][j] = in.Element[j][i];
out.Element[j][i] = temp;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment