CPolarCoordinate

$Revision: 3 $

Description

This class encapsulates a polar coordinate. A polar coordinate is made up of two angles and one distance. The angles originate at the center of the Earth. One angle measures up and down (latitude) while the other measures left and right (longitude). The distance is the altitude above the surface of the Earth. Positive angles approach north and east while negative values for an angle run south and west.

Constructors

CPolarCoordinate()
CPolarCoordinate( const CPolarCoordinate& source )
Constructs an empty coordinate or copies another CPolarCoordinate.

Methods

void Copy( const CPolarCoordinate& coordinate )
Copies the contents of another CPolarCoordinate.
void Get( double& up_down_angle, double& left_right_angle, double& distance )
This allows you to retrieve all the data members in one function call.
double GetUpDownAngleInDegrees( void ) const
This method returns the up/down angle in degrees.
double GetLeftRightAngleInDegrees( void ) const
This method returns the left/right angle in degrees.
double GetDistanceFromSurfaceInMeters( void ) const
This method returns the distance from the surface of the ellipsoid.
void Set( double up_down_angle, double left_right_angle, double distance )
This lets you set all of the data members in a single function call.
void SetUpDownAngleInDegrees( double up_down_angle )
This method sets the up/down angle.
void SetLeftRightAngleInDegrees( double left_right_angle )
This method sets the left/right angle.
void SetDistanceFromSurfaceInMeters( double distance )
This method sets the distance from the surface of the ellipsoid.

Operators

= ( const CPolarCoordinate& source )
Basically calls Copy().

Example

#include <stdio.h>
#include <GFC.h>
#pragma hdrstop

void main( void )
{
   CPolarCoordinate here;
   CPolarCoordinate there;

   // here is 39 degrees 12.152 minutes North Latitude, 76 degrees 46.795 minutes West Longitude
   here.SetUpDownAngleInDegrees(     CMath::ConvertDegreesMinutesSecondsCoordinateToDecimalDegrees(  39.0, 12.152, 0.0 ) );
   here.SetLeftRightAngleInDegrees(  CMath::ConvertDegreesMinutesSecondsCoordinateToDecimalDegrees( -76.0, 46.795, 0.0 ) );
   here.SetDistanceFromSurfaceInMeters( 1000.0 );

   there = here;
}
Copyright, 1997, Samuel R. Blackburn
$Workfile: CPolarCoordinate.cpp $
$Modtime: 5/21/97 6:12a $