// ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» // º Matric2.C º // º º // º For 2*2 Matrices's uses º // º º // º By Volpone of Malorean Effect º // º for crazy mathematicians like Toto º // º º // º º // º Version 1.0 º // º Release December 1993 º // º º // º Hello to : Toto,Sally,42 Crew,Aghesacha, º // º Mc2,Sun,Redlight,Locked,Fafa º // º Silk,Weg,FBI,TmB º // º º // ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ typedef struct {int M11,M12,M21,M22 ; } IntMatrix2; inline IntMatrix2 Affect (int A11,int A12,int A21,int A22 ); inline IntMatrix2 Identity (void); inline IntMatrix2 Tr (IntMatrix2 U ); inline IntMatrix2 Inv (IntMatrix2 U ); inline IntMatrix2 Neg (IntMatrix2 U ); inline int Abs (IntMatrix2 U ); inline IntMatrix2 operator + (IntMatrix2 U,IntMatrix2 V); inline IntMatrix2 operator - (IntMatrix2 U,IntMatrix2 V); inline IntMatrix2 operator * (IntMatrix2 U,IntMatrix2 V); inline IntMatrix2 operator * (int N,IntMatrix2 V); //----------------------------------------------------------------------- inline IntMatrix2 Affect (int A11,int A12,int A21,int A22 ) { IntMatrix2 Buffer; Buffer.M11=A11; Buffer.M12=A12; Buffer.M21=A21; Buffer.M22=A22; return (Buffer);} //----------------------------------------------------------------------- inline IntMatrix2 Identity (void) { IntMatrix2 Buffer; Buffer.M11=1; Buffer.M12=0; Buffer.M21=0; Buffer.M22=1; return (Buffer);} //----------------------------------------------------------------------- inline IntMatrix2 Tr (IntMatrix2 U ) { IntMatrix2 Buffer; Buffer.M11=U.M11; Buffer.M12=U.M21; Buffer.M21=U.M12; Buffer.M22=U.M22; return (Buffer);} //----------------------------------------------------------------------- inline IntMatrix2 operator + (IntMatrix2 U,IntMatrix2 V) { IntMatrix2 Buffer; Buffer.M11=U.M11+V.M11; Buffer.M12=U.M12+V.M12; Buffer.M21=U.M21+V.M21; Buffer.M22=U.M22+V.M22; return (Buffer);} //----------------------------------------------------------------------- inline IntMatrix2 operator - (IntMatrix2 U,IntMatrix2 V) { IntMatrix2 Buffer; Buffer.M11=U.M11-V.M11; Buffer.M12=U.M12-V.M12; Buffer.M21=U.M21-V.M21; Buffer.M22=U.M22-V.M22; return (Buffer);} //----------------------------------------------------------------------- inline IntMatrix2 operator * (IntMatrix2 U,IntMatrix2 V) { IntMatrix2 Buffer; Buffer.M11=U.M11*V.M11+U.M12*V.M21; Buffer.M21=U.M21*V.M11+U.M22*V.M21; Buffer.M12=U.M11*V.M12+U.M12*V.M22; Buffer.M22=U.M21*V.M12+U.M22*V.M22; return (Buffer);} //----------------------------------------------------------------------- inline IntMatrix2 operator * (int N,IntMatrix2 V) { IntMatrix2 Buffer; Buffer.M11=N*V.M11; Buffer.M12=N*V.M21; Buffer.M21=N*V.M12; Buffer.M22=N*V.M22; return (Buffer);} //----------------------------------------------------------------------- inline IntMatrix2 Neg (IntMatrix2 U ) { IntMatrix2 Buffer; Buffer.M11=-U.M11; Buffer.M12=-U.M21; Buffer.M21=-U.M12; Buffer.M22=-U.M22; return (Buffer);} //----------------------------------------------------------------------- inline int Abs (IntMatrix2 U ) { int Buffer; Buffer=U.M11*U.M22-U.M12-U.M21; return (Buffer);} //-----------------------------------------------------------------------