VecAngle.H

Go to the documentation of this file.
00001 // $Revision: 1.3 $  $Author: schwehr $  $Date: 2006/03/01 00:37:03 $
00002 /*
00003     Copyright (C) 2004  Kurt Schwehr
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 */
00020 #ifndef _VECANGLE_H_
00021 #define _VECANGLE_H_
00022 
00023 #include <math.h>
00024 
00027 
00033 inline double rad2deg (const float &rad) {return(rad/M_PI * 180.);}
00039 inline double deg2rad (const float &deg) {return(deg/180. * M_PI);}
00040 
00045 void flip (double &dec, double &dip); 
00049 void flip (float &dec, float &dip);
00050 
00051 
00056 float normRadAngle(float angleRad);
00057 
00067 void rotateXY (const float x1, const float y1, const float angleRad, float &x2, float &y2);
00068 
00069 
00077 void xyz2tpr (const double x, const double y, const double z, double &theta, double &phi, double &radius);
00078 
00084 void ldi2xyz( const float len, const float dec, const float inc, std::vector<float> &xyz);
00085 
00090 inline bool isEqual (const float a, const float b, const float del) {
00091   return ( ( a<b+del && a > b-del) ? true : false );
00092 }
00093 
00094 
00095 #endif // _VECANGLE_H_

Generated on Thu Mar 2 17:55:25 2006 for density by  doxygen 1.4.6