Click or drag to resize

MagneticExtensionsGetMagnetic Method (Coordinate, Distance, DataModel)

Creates a Magnetic object from a Coordinate with a specified height above MSL and a provided data model.

Namespace:  CoordinateSharp.Magnetic
Assembly:  CoordinateSharp.Magnetic (in CoordinateSharp.Magnetic.dll) Version: 1.1.2.0
Syntax
C#
public static Magnetic GetMagnetic(
	this Coordinate coordinate,
	Distance height,
	DataModel dataModel
)

Parameters

coordinate
Type: CoordinateSharpCoordinate
Coordinate
height
Type: CoordinateSharpDistance
Height
dataModel
Type: CoordinateSharp.MagneticDataModel
Data Model

Return Value

Type: Magnetic
Magnetic

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Coordinate. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Examples
Creating a Magnetic object from a coordinate with a specified height..
Coordinate c = Coordinate(25,25, new DateTime(2020,1,1));
Distance d = new Distance(10, DistanceType.Miles); //Height is 10 miles above MSL
Magnetic m = c.GetMagnetic(d, DataModel.WMM2020);
See Also