|
GPS ToolKit.NET
Position.BearingFrom Method
Gets the initial bearing from the given position
Syntax
[Visual Basic]
object.BearingFrom(Position)
[C#]
object.BearingFrom(Position)
[C++]
object->BearingFrom(Position)
Parameters
object
An object expression that evaluates to a GPSToolKit object.
Position
A Position object from which the bearing is calculated
Return Value
An Angle object containing the beraring from the given position
Remarks
For large distances between positions, the bearing from the given position will change along the great circle path connecting the given position and the position represented by this object. This method calculates only the initial bearing from the given position.
Errors
If either of the positions in the bearing calculation are not valid, the IsValid property of the returned Angle object will be false.
Example
[Visual Basic]
' Get bearing from an initial position to the current position
Dim bearing As Angle
Dim currPosition, initialPosition As Position
initialPosition = New Position(42.10, -75.2)
currPosition = myGPSToolKit.Position
bearing = currPosition.BearingFrom(initialPosition)
[C#]
// Get bearing from an initial position to the current position
Angle bearing;
Position currPosition, initialPosition;
initialPosition = new Position(42.10, -75.2);
currPosition = myGPSToolKit.Position;
bearing = currPosition.BearingFrom(initialPosition);
[C++]
// Get bearing from an initial position to the current position
Angle *bearing;
Position *currPosition, *initialPosition;
initialPosition = new Position(42.10, -75.2);
currPosition = myGPSToolKit->Position;
bearing = currPosition->BearingFrom(initialPosition);
See Also
Position.BearingTo method | Position.DistanceTo method
|