Point Class Reference

Describe a specific point on the Earth surface. It can also store details about that point, such as its elevation and vegetation. Provides functions such as distance between two points, and projection along a bearing. More...

#include <geom.h>

List of all members.

Public Member Functions

 Point ()
 Point (double _lat, double _lon)
 Point (double _lat, double _lon, double _towerHeight)
double distance (Point *p)
double bearing (Point *p)
Pointproject (double bearing, double distance)

Public Attributes

double lat
 Actual latitude of this point.
double lon
 Actual longitude of this point.
double elev
 Optional elevation of given point, usually filled by a Source object.
double towerHeight
 Optional height of a tower at this point.
double vegHeight
 Optional height of vegetation above ground elevation at this point, usually filled by a Source object.
int vegType
 Optional raw vegetation type, usually filled by vegetation Source object.
int vegCover
 Optional percentage (0-100) of vegetation cover as read from vegetation Source object.
int landType
 Optional raw land use type, usually filled by a land-use Source object.

Friends

ostream & operator<< (ostream &output, const Point &p)
 Output point in "(lat,long)" format.
ofstream & operator<< (ofstream &output, const Point &p)
 Output point in "lat\tlong" format.
ifstream & operator>> (ifstream &input, Point &p)
 Read in point in "lat\tlong" format.


Detailed Description

Describe a specific point on the Earth surface. It can also store details about that point, such as its elevation and vegetation. Provides functions such as distance between two points, and projection along a bearing.

Constructor & Destructor Documentation

Point::Point (  ) 

Point::Point ( double  _lat,
double  _lon 
)

Create new Point object with given coordinates.

Parameters:
_lat Latitude to assign to new point (range -90 to 90)
_lon Longitude to assign to new point (range -180 to 180)

Point::Point ( double  _lat,
double  _lon,
double  _towerHeight 
)

Create new Point object with given coordinates. Also set the height of a tower at this point to the height given in meters.

Parameters:
_lat Latitude to assign to new point (range -90 to 90)
_lon Longitude to assign to new point (range -180 to 180)
_towerHeight Height to assign to tower at this point (in meters)


Member Function Documentation

double Point::distance ( Point p  ) 

Calculate the distance between this point and the second given point.

Parameters:
p Second point to compare this object against
Returns:
Distance between the two given points in kilometers

double Point::bearing ( Point p  ) 

Calculate the compass bearing from this point towards the second given point. If we walk from this point using the returned bearing, we will reach the second point.

Parameters:
p Second point to compare this object against.
Returns:
Bearing from this point towards second given point (value returned in radians (range 0 to 2)

Point* Point::project ( double  bearing,
double  distance 
)

Project this point along the given bearing line for the given distance and return the new point.

Parameters:
bearing Bearing to follow from this point in radians (range 0 to 2)
distance Distance to walk along bearing line in kilometers
Returns:
New point object after walking given distance along the bearing line.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  output,
const Point p 
) [friend]

Output point in "(lat,long)" format.

ofstream& operator<< ( ofstream &  output,
const Point p 
) [friend]

Output point in "lat\tlong" format.

ifstream& operator>> ( ifstream &  input,
Point p 
) [friend]

Read in point in "lat\tlong" format.


Member Data Documentation

double Point::lat

Actual latitude of this point.

double Point::lon

Actual longitude of this point.

double Point::elev

Optional elevation of given point, usually filled by a Source object.

double Point::towerHeight

Optional height of a tower at this point.

double Point::vegHeight

Optional height of vegetation above ground elevation at this point, usually filled by a Source object.

int Point::vegType

Optional raw vegetation type, usually filled by vegetation Source object.

int Point::vegCover

Optional percentage (0-100) of vegetation cover as read from vegetation Source object.

int Point::landType

Optional raw land use type, usually filled by a land-use Source object.


The documentation for this class was generated from the following file:
Generated on Sat Feb 23 21:49:22 2008 for libprop by  doxygen 1.5.4