# Magnetic to True North

![](/files/jrrTWYl57fUxktw8XRDz)

![](/files/q99hpILveUAgkhsBipo9) - [\[source code\]](https://github.com/ladybug-tools/ladybug-grasshopper/blob/master/ladybug_grasshopper/src//LB%20Magnetic%20to%20True%20North.py)

Compute a True North angle and vector from Magnetic North at a given location.

This component uses then World Magnetic Model (WMM) developed and maintained by NOAA. <https://www.ncei.noaa.gov/products/world-magnetic-model>

### Inputs

* **location \[Required]**

A ladybug Location that has been output from the "LB Import EPW" component or the "LB Construct Location" component. This is used to determine the difference between magnetic and true North.

* **mag\_north \[Required]**

A number between -360 and 360 for the counterclockwise difference between Magnetic North and the positive Y-axis in degrees. Counterclockwise means "90 is West and 270 is East". This can also be Vector for the magnetic North direction.

* **year**

A number for the year in which the Magnetic North was evaluated. Decimal values are accepted. This is needed as the location of Magnetic North has been moving at a rate of roughly 50 km/year for the past couple of decades. (Default: 2025).

* **cof\_file**

An optional path to a .COF file containing the coefficients that form the inputs for the World Magnetic Model (WMM). A new set of coefficients is published roughly every 5 years as the magnetic poles continue to move. If unspecified, coefficients will be taken from the most recent model. COF files with the most recent coefficients and historical values are available at:

### Outputs

* **mag\_declination**

The magnetic declination in degrees. Magnetic declination is the difference between magnetic North and true North at a given location on the globe (expressed in terms of degrees).

* **true\_north**

A number between -360 and 360 for the True North angle in degrees.

* **true\_north\_vec**

A vector for the True North direction. This can be plugged into any of the north\_ inputs of the other LAdybug Tools components.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ladybug.tools/ladybug-primer/components/4_extra/magnetic_to_true_north.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
