@Override public void getColumn0(DVector3 result) { result.set(get00(), get10(), get20()); }
@Override public void getColumn0(DVector3 result) { result.set(get00(), get10(), get20()); }
double dMatrix3Det( final DMatrix3 mat ) { double det; // det = mat.v[0] * ( mat.v[5]*mat.v[10] - mat.v[9]*mat.v[6] ) // - mat.v[1] * ( mat.v[4]*mat.v[10] - mat.v[8]*mat.v[6] ) // + mat.v[2] * ( mat.v[4]*mat.v[9] - mat.v[8]*mat.v[5] ); det = mat.get00() * ( mat.get11()*mat.get22() - mat.get21()*mat.get12() ) - mat.get01() * ( mat.get10()*mat.get22() - mat.get20()*mat.get12() ) + mat.get02() * ( mat.get10()*mat.get21() - mat.get20()*mat.get11() ); return( det ); }
double dMatrix3Det( final DMatrix3 mat ) { double det; // det = mat.v[0] * ( mat.v[5]*mat.v[10] - mat.v[9]*mat.v[6] ) // - mat.v[1] * ( mat.v[4]*mat.v[10] - mat.v[8]*mat.v[6] ) // + mat.v[2] * ( mat.v[4]*mat.v[9] - mat.v[8]*mat.v[5] ); det = mat.get00() * ( mat.get11()*mat.get22() - mat.get21()*mat.get12() ) - mat.get01() * ( mat.get10()*mat.get22() - mat.get20()*mat.get12() ) + mat.get02() * ( mat.get10()*mat.get21() - mat.get20()*mat.get11() ); return( det ); }
@Override public final float[] toFloatArray() { return new float[]{ (float)get00(), (float)get01(), (float)get02(), (float)get10(), (float)get11(), (float)get12(), (float)get20(), (float)get21(), (float)get22() }; }
@Override public final float[] toFloatArray12() { return new float[]{ (float)get00(), (float)get01(), (float)get02(), 0.0f, (float)get10(), (float)get11(), (float)get12(), 0.0f, (float)get20(), (float)get21(), (float)get22(), 0.0f }; }
@Override public final float[] toFloatArray12() { return new float[]{ (float)get00(), (float)get01(), (float)get02(), 0.0f, (float)get10(), (float)get11(), (float)get12(), 0.0f, (float)get20(), (float)get21(), (float)get22(), 0.0f }; }
@Override public final float[] toFloatArray() { return new float[]{ (float)get00(), (float)get01(), (float)get02(), (float)get10(), (float)get11(), (float)get12(), (float)get20(), (float)get21(), (float)get22() }; }
static void dMat3GetCol(final DMatrix3 m,final int col, DVector3 v) { // v.set0( m.v[col + 0] ); // v.set1( m.v[col + 4] ); // v.set2( m.v[col + 8] ); if (col ==0) { v.set( m.get00(), m.get10(), m.get20() ); } else if (col == 1) { v.set( m.get01(), m.get11(), m.get21() ); } else if (col == 2) { v.set( m.get02(), m.get12(), m.get22() ); } else { throw new IllegalArgumentException("col="+col); } }
static void dMat3GetCol(final DMatrix3 m,final int col, DVector3 v) { // v.set0( m.v[col + 0] ); // v.set1( m.v[col + 4] ); // v.set2( m.v[col + 8] ); if (col ==0) { v.set( m.get00(), m.get10(), m.get20() ); } else if (col == 1) { v.set( m.get01(), m.get11(), m.get21() ); } else if (col == 2) { v.set( m.get02(), m.get12(), m.get22() ); } else { throw new IllegalArgumentException("col="+col); } }
/** * Create a new transposed version of this matrix. * @return The transposed copy of this matrix. */ @Override public final DMatrix3 reTranspose() { return new DMatrix3( get00(), get10(), get20(), get01(), get11(), get21(), get02(), get12(), get22()); }
/** * Create a new transposed version of this matrix. * @return The transposed copy of this matrix. */ @Override public final DMatrix3 reTranspose() { return new DMatrix3( get00(), get10(), get20(), get01(), get11(), get21(), get02(), get12(), get22()); }
private void transpose3x3 (DMatrix3 A) { double tmp; tmp=A.get10(); A.set10( A.get01() ); A.set01( tmp ); tmp=A.get20(); A.set20( A.get02() ); A.set02( tmp ); tmp=A.get21(); A.set21( A.get12() ); A.set12( tmp ); }
/** * Transpose this matrix. * @return This matrix. */ public final DMatrix3 eqTranspose() { double t; t = get01(); set01( get10() ); set10( t ); t = get02(); set02( get20() ); set20( t ); t = get21(); set21( get12() ); set12( t ); return this; }
/** * Transpose this matrix. * @return This matrix. */ public final DMatrix3 eqTranspose() { double t; t = get01(); set01( get10() ); set10( t ); t = get02(); set02( get20() ); set20( t ); t = get21(); set21( get12() ); set12( t ); return this; }
/** * Calculates the dot product of the the specified row of this matrix * with the given vector. * @param row row pos * @param v3 vector */ @Override public final double dotRow(int row, DVector3C v3) { if (row == 0) { return get00()*v3.get0() + get01()*v3.get1() + get02()*v3.get2(); } else if (row == 1) { return get10()*v3.get0() + get11()*v3.get1() + get12()*v3.get2(); } else if (row == 2) { return get20()*v3.get0() + get21()*v3.get1() + get22()*v3.get2(); } else { throw new IllegalArgumentException("row="+row); } }
private boolean cmpIdentityMat3 (DMatrix3 A) { return (cmp(A.get00(),1.0) && cmp(A.get01(),0.0) && cmp(A.get02(),0.0) && cmp(A.get10(),0.0) && cmp(A.get11(),1.0) && cmp(A.get12(),0.0) && cmp(A.get20(),0.0) && cmp(A.get21(),0.0) && cmp(A.get22(),1.0)); }
boolean cmpIdentityMat3 (DMatrix3 A) { return (cmp(A.get00(),1.0) && cmp(A.get01(),0.0) && cmp(A.get02(),0.0) && cmp(A.get10(),0.0) && cmp(A.get11(),1.0) && cmp(A.get12(),0.0) && cmp(A.get20(),0.0) && cmp(A.get21(),0.0) && cmp(A.get22(),1.0)); }
public DMatrix3 add(DMatrix3C m) { set00( get00() + m.get00() ); set01( get01() + m.get01() ); set02( get02() + m.get02() ); set10( get10() + m.get10() ); set11( get11() + m.get11() ); set12( get12() + m.get12() ); set20( get20() + m.get20() ); set21( get21() + m.get21() ); set22( get22() + m.get22() ); // DMatrix3 M = (DMatrix3) M2; // for (int i = 0; i < v.length; i++) { // v[i] += M.v[i]; // } return this; }
public DMatrix3 add(DMatrix3C m) { set00( get00() + m.get00() ); set01( get01() + m.get01() ); set02( get02() + m.get02() ); set10( get10() + m.get10() ); set11( get11() + m.get11() ); set12( get12() + m.get12() ); set20( get20() + m.get20() ); set21( get21() + m.get21() ); set22( get22() + m.get22() ); // DMatrix3 M = (DMatrix3) M2; // for (int i = 0; i < v.length; i++) { // v[i] += M.v[i]; // } return this; }