About GPS ToolKit.NET
Introduction
Purchasing GPS ToolKit.NET
Redistributing GPS ToolKit.NET
License Agreement
Support
Getting Started
Getting Started
Setting up the GPS
Basic Concepts
GPS ToolKit Sample Projects
About GPS ToolKit Errors
Reference
GPSToolKit Class
Properties
BaudRate
ExtendedFixData
IsGPSConnected
IsPortOpen
LastPositionUpdateTime
NavigationData
PortName
Protocol
Position
Satellites
Speed
TrueCourse
Methods
AddRoute
AddTrack
AddWaypoint
AutoDetectGPS
Close
GetAvailableSystemPorts
GetGPSInfo
GetRoutes
GetSystemPorts
GetTracks
GetWaypoints
Open
ShutOffGPS
WriteRawBinaryToGPS
WriteRawToGPS
Events
FileComplete
GPSConnected
GPSDisconnected
NavigationUpdate
PositionUpdate
RawDataReceived
SatelliteUpdate
Supporting Classes
Altitude
Angle
Distance
ExtendedFixData
Properties
DGPSRefStationID
EstimatedHorizontalError
EstimatedPositionError
EstimatedVerticalError
FixMode
GeoidHeightAboveWGS84
HDOP
MagneticVariation
NumSatellitesInView
PDOP
TimeSinceLastDGPSUpdate
VDOP
GPSInfo
Latitude
Methods
ToDecimalDegreesString
ToDegreesMinutesString
ToDegreesMinutesSecondsString
Longitude
Methods
ToDecimalDegreesString
ToDegreesMinutesString
ToDegreesMinutesSecondsString
NavData
Properties
ActiveRoute
ArrivedAtDest
CrossTrackError
DestWptName
DestWptPosition
IsValid
MagBearingFromOriginToDest
OriginWptName
TrueBearingFromOriginToDest
TrueBearingToDestWpt
VelocityTowardDestWpt
Position
Methods
BearingFrom
BearingTo
DistanceTo
Route
Properties
Name
Waypoints
Satellite
Speed
Track
Properties
Color
DisplayTrack
Name
TrackPoints
TrackPoint
Waypoint
Collections
RouteCollection
SatelliteCollection
TrackCollection
TrackPointCollection
WaypointCollection

Position.BearingTo Method

Gets the initial bearing to the given position

Syntax

[Visual Basic]
object.BearingTo(Position)

[C#]
object.BearingTo(Position)

[C++]
object->BearingTo(Position)

Parameters

object

An object expression that evaluates to a GPSToolKit object.

Position

A Position object to which the bearing is calculated

Return Value

An Angle object containing the beraring to the given position

Remarks

For large distances between positions, the bearing to 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 to 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 = initialPosition.BearingTo(currPosition)


[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 = initialPosition.BearingFrom(currPosition);


[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 = initialPosition->BearingFrom(currPosition);

See Also

Position.BearingFrom method | Position.DistanceTo method