[Gcblue-commits] gcb_wx/src/common simmath.cpp,1.6,1.7
Status: Alpha
Brought to you by:
ddcforge
From: <ddc...@us...> - 2004-02-07 02:22:50
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14729/src/common Modified Files: simmath.cpp Log Message: Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** simmath.cpp 1 Feb 2004 22:19:08 -0000 1.6 --- simmath.cpp 7 Feb 2004 02:19:54 -0000 1.7 *************** *** 102,105 **** --- 102,117 ---- /******************************* tcGeoRect ********************************/ + + /** + * @return true if point (lon,lat) in radians is within + * @return region. + */ + bool tcGeoRect::ContainsPoint(float lon, float lat) + { + tsGeoPoint p; + p.Set(lon, lat, 0); + return GeoWithinRegion(p, this) != 0; + } + float tcGeoRect::Width() { if (right > left) {return right-left;} *************** *** 123,126 **** --- 135,141 ---- } + /** + * radian units + */ void tcGeoRect::Set(float x1,float x2,float y1,float y2) { if (x1 < -C_PI) {x1 += C_TWOPI;} *************** *** 151,154 **** --- 166,178 ---- } + /** + * accepts longitude and latitude arguments in degrees units + */ + void tcGeoRect::SetDegrees(float lon1_deg, float lon2_deg, float lat1_deg, float lat2_deg) + { + tcGeoRect::Set(C_PIOVER180*lon1_deg, C_PIOVER180*lon2_deg, + C_PIOVER180*lat1_deg, C_PIOVER180*lat2_deg); + } + // forces r to be within tcGeoRect, assumes dimensions of r don't exceed tcGeoRect // dimensions |