# ComputeDirect Method

### [VB]

Public Function ComputeDirect(ByVal fromPoint As GeoCalcNET.GeodeticPoint, ByVal geodesic As Double, ByVal azimuth As Double, ByVal toPoint As GeoCalcNET.GeodeticPoint) As Boolean

### [C#]

public System.Boolean ComputeDirect(GeoCalcNET.GeodeticPoint fromPoint, System.Double geodesic, System.Double azimuth, GeoCalcNET.GeodeticPoint toPoint)

## Description

The ComputeDirect method takes a GeodeticPoint, a geodesic distance, and an azimuth angle as input and produces a GeodeticPoint as output.  The input values occupy the first three arguments of the method and the output point fills the fourth argument.  The method computes a Great Circle that passes through the input point at the specified azimuth.  It then finds the point that lies on the Great Circle the specified distance from the input point in the direction of the specified azimuth.  This point is stored in the GeodeticPoint that occupies the fourth argument to the method.  The method returns a boolean value indicating the success of the operation.

The azimuth value is assumed to be given in radians, and the geodesic distance is assumed to be given in meters.

If a three-dimensional GeodeticPoint is used, this method will ignore the Height coordinate on the input point.  The Height of the point will be assumed to be 0, so that the calculations occur on the surface of the Ellipsoid.  The Height of the output point will be equal to the Height of the input point.

## Example

### [VB]

Private Sub GeoCalcNET_Ellipsoid_ComputeDirect(ByVal ell As GeoCalcNET.Ellipsoid, ByVal data As GeoCalcNET.DataSourceComponent)

Dim fromPT As GeoCalcNET.GeodeticPoint = data.GetGeodeticPoint("BMG", "GEODETIC_POINT_DEGREES")

fromPT.SetInUnits(0, 0)

Dim toPT As GeoCalcNET.GeodeticPoint = data.GetGeodeticPoint("BMG", "GEODETIC_POINT_DEGREES")

Dim geodesic As Double = 25

Dim azimuth As Double = 0

If Not ell.ComputeDirect(fromPT, geodesic, azimuth, toPT) Then

MessageBox.Show("ComputeDirect failed")

End If

End Sub

### [C#]

private void GeoCalcNET_Ellipsoid_ComputeDirect(GeoCalcNET.Ellipsoid ell, GeoCalcNET.DataSourceComponent data)

{

GeoCalcNET.GeodeticPoint pt1 = data.GetGeodeticPoint("BMG", "GEODETIC_POINT_DEGREES");

GeoCalcNET.GeodeticPoint pt2 = data.GetGeodeticPoint("BMG", "GEODETIC_POINT_DEGREES");

pt1.SetInUnits(42.11, 0.99902);

double geodesic = 34;

double azimuth = 1.0084;

if(! ell.ComputeDirect(pt1, geodesic, azimuth, pt2))

{

MessageBox.Show("unable to compute output point");

}

}