Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

MathUtilities.h

Go to the documentation of this file.
00001 
00002 //
00003 //    Title     : MathUtilities.h
00004 //    Project     : OSCAR Version 2.0
00005 //    Created     : 1/12/1996
00006 //    Author      : Chetan Kapoor and Kevin Rackers
00007 //      Platforms       : All
00008 //      Copyright       : Copyright The University of Texas at Austin, 2002. All rights reserved.
00009 //
00010 //          This software and documentation constitute an unpublished work
00011 //          and contain valuable trade secrets and proprietary information
00012 //          belonging to the University. None of the foregoing material may be
00013 //          copied or duplicated or disclosed without the express, written
00014 //          permission of University. THE UNIVERSITY EXPRESSLY DISCLAIMS ANY
00015 //          AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION,
00016 //          INCLUDING ANY WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 //          PARTICULAR PURPOSE, AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY
00018 //          THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE.
00019 //          NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF
00020 //          THE SOFTWARE OR DOCUMENTATION. Under no circumstances shall the
00021 //          University be liable for incidental, special, indirect, direct or
00022 //          consequential damages or loss of profits, interruption of business,
00023 //          or related expenses which may arise from use of software or documentation,
00024 //          including but not limited to those resulting from defects in software
00025 //          and/or documentation, or loss or inaccuracy of data of any kind.
00026 //
00027 //    Purpose     : Miscellaneous functions for use with Math stuff
00028 //-----------------------------------------------------------------------------
00029 //
00030 //    $Revisions$
00031 //
00032 //    $Log: MathUtilities.h,v $
00033 //    Revision 1.17  2005/03/14 22:04:19  pmarch
00034 //    Added to namespace OSCAR and removed "RR" from front of class names.
00035 //
00036 //    Revision 1.16  2004/07/29 20:45:21  chetan
00037 //    Added extern to all stand alone functions declared in MathUtilities.h and defined in MathUtilities.C
00038 //
00039 //    Revision 1.15  2004/06/08 23:00:04  chetan
00040 //    Performance improvements and better error handling
00041 //
00042 //    Revision 1.14  2004/05/26 20:01:59  pmarch
00043 //    Added /defgroup and /ingroup tags.
00044 //
00045 //    Revision 1.13  2004/05/12 13:49:03  eswint
00046 //    - Corrected the Dot() function to take const references instead of objects
00047 //
00048 //    Revision 1.12  2004/04/05 22:01:23  eswint
00049 //    - Added an operator*(Xform,Vector3) that returns an Vector3
00050 //    - Added a Multiply(Xform lhs, Vector3 rhs, Vector3 result)
00051 //
00052 //    Revision 1.11  2004/01/26 20:54:33  pmarch
00053 //    Fixed documentation errors as reported by Doxygen.
00054 //
00055 //    Revision 1.10  2003/09/09 17:13:10  eswint
00056 //    - Changed #include "Math/..." to #include "..."
00057 //
00058 //    Revision 1.9  2003/09/02 20:30:09  eswint
00059 //    - Moved multiplication operations between matrices and vectors into their respective classes
00060 //
00061 //    Revision 1.8  2003/08/26 22:25:37  eswint
00062 //    - Moved binary operator* for quaternions into class
00063 //
00064 //    Revision 1.7  2003/08/25 20:29:06  eswint
00065 //    - Defined binary operator* for VectorNumeric with scalar as left hand argument
00066 //
00067 //    Revision 1.6  2003/08/21 22:02:43  eswint
00068 //    - Removed VectorNumeric operators +,- since VC 6 doesn't support templates enough to obtain desired behavoir
00069 //
00070 //    Revision 1.5  2003/08/21 19:05:53  eswint
00071 //    - Clarified the VectorNumeric operator+, operator- comments
00072 //
00073 //    Revision 1.4  2003/08/21 18:17:57  mtisius
00074 //    Corrected operator+ and operator- methods and added operator/ to VectorNumeric
00075 //
00076 //    Revision 1.3  2003/08/19 18:22:46  eswint
00077 //    -Cleaned up commenting
00078 //
00079 //    Revision 1.2  2003/08/19 18:09:29  eswint
00080 //    - Added Orthog method to VectorNumeric to orthogonalize function parameter against calling object
00081 //    - Moved Norm, Normalize, and Unit from Vector3 to VectorNumeric
00082 //
00083 //    Revision 1.1  2003/08/18 15:23:35  eswint
00084 //    Initial Commit
00085 //
00086 //
00088 #ifndef MathUtilities_hpp
00089 #define MathUtilities_hpp
00090 
00091 #include "Array.h"
00092 #include "Matrix.h"
00093 #include "Quaternion.h"
00094 #include "Vector.h"
00095 #include "Vector3.h"
00096 
00098 namespace OSCAR {
00099 
00110   extern Vector GetRow(unsigned int row, const Matrix& m);
00111 
00122   extern Vector GetCol(unsigned int col, const Matrix& m);
00123 
00134   extern void GetRow(Vector& result, unsigned int row, const Matrix& m);
00135 
00146   extern void GetCol(Vector& result, unsigned int col, const Matrix& m);
00147 
00158   extern Vector3 Cross3(const Vector3& v1, const Vector3& v2);
00159 
00170   extern Vector3 Cross3Unit(const Vector3& v1, const Vector3& v2);
00171 
00182   extern Matrix operator*(double a,const Matrix& m);
00183 
00193   extern Vector3 operator*(const Xform& lhs, const Vector3& rhs);
00194 
00204   extern void Multiply(const Xform& lhs, const Vector3& rhs, Vector3& result);
00205 
00206 
00217   template <class Type>
00218   VectorNumeric<Type> operator*(Type a,const VectorNumeric<Type>& v);
00219 
00231   template <class To, class From>
00232   To Convert(const From& f);
00233 
00242   template <class Type>
00243   Type Dot(const VectorNumeric<Type>& v1, const VectorNumeric<Type>& v2);
00244 
00245   #include "MathUtilities.ipp"
00246 
00247 }
00248 
00249 #endif /* MathUtilities_hpp */
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations