Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MatrixMath.h
00001 /** 00002 * @file MatrixMath.h 00003 * @author Ernesto Palacios 00004 * 00005 * Created on 15 de septiembre de 2011, 09:44 AM. 00006 * 00007 * Develop Under GPL v3.0 License 00008 * http://www.gnu.org/licenses/gpl-3.0.html 00009 * 00010 */ 00011 00012 #ifndef MATRIXMATH_H 00013 #define MATRIXMATH_H 00014 00015 #include "mbed.h" 00016 #include "Matrix.h" 00017 00018 00019 /** 00020 * @brief This class provides STATIC methods to preform operations over 00021 * Matrix Objects 00022 * version 0.8. 00023 * 00024 * Methods will be added as neccesary. 00025 * 00026 */ 00027 class MatrixMath{ 00028 public: 00029 00030 00031 /**@brief 00032 * Transposes Matrix, return new Object. 00033 * @param Mat matrix to calculate 00034 * @return the determinant 00035 */ 00036 static Matrix Transpose( const Matrix& Mat ); 00037 00038 00039 /**@brief 00040 * Calculate the inverse of a nxn Matrix BUT check first if the determinant 00041 * is != 0. Same matrix will be return if Det( Mat ) == 0. 00042 * @param Mat matrix to calcute inverse. 00043 * @return Matrix Inverse 00044 */ 00045 static Matrix Inv( const Matrix& Mat ); 00046 00047 00048 static float dotProduct( const Matrix& leftM, const Matrix& rightM ); 00049 00050 /**@brief Calculates the determinant of a Matrix. 00051 * @param Mat matrix to calculate. 00052 * @return the determinant. 00053 */ 00054 static float det( const Matrix& Mat ); 00055 00056 00057 //** For Kinematics **// 00058 00059 static Matrix RotX( const Matrix& matrix, float radians ); 00060 00061 static Matrix RotY( const Matrix& matrix, float radians ); 00062 00063 static Matrix RotZ( const Matrix& matrix, float radians ); 00064 00065 static Matrix Transl( const Matrix& matrix, float x, float y, float z ); 00066 00067 private: 00068 00069 /**@brief 00070 * Calculates the Determinant of a 3x3 Matrix 00071 * @param Mat Already made sure is a 3 by 3 00072 * @return Float, determinant. 00073 */ 00074 float Det3x3( const Matrix& Mat ); 00075 00076 }; 00077 00078 #endif /* MATRIXMATH_H */
Generated on Wed Jul 13 2022 22:04:07 by
1.7.2