# Wolfram Mathematica

## Ranges of Values of the Earth's Magnetic Field

The new functions CoordinateBounds and CoordinateBoundingBox allow you to find the extrema values in each dimension of a multidimensional array. This example finds the ranges of values of the Earth's magnetic field in a given region.

Define a region near the North Pole from its latitudes and longitudes.

In:= ```lat = {65, 85}; lon = {-30, 30};```

Plot this region on a world map.

In:= ```GeoGraphics[GeoBoundsRegion[{lat, lon}], GeoGridLines -> Automatic, GeoZoomLevel -> 5]```
Out= Generate the data of the Earth's magnetic field in this region.

In:= `data = GeomagneticModelData[Transpose[{lat, lon}], GeoZoomLevel -> 1]`
Out= Extract from this data the components of the Earth's magnetic field.

In:= ```components = {"NorthComponent", "EastComponent", "DownComponent"}; arr = Lookup[data, components]```
Out= Convert the list of arrays into an array of 3-vectors.

In:= `qa = Transpose[QuantityArray[arr], {3, 1, 2}]`
Out= These are the ranges of the components of the Earth's magnetic field in the specified region.

In:= `Thread[components -> CoordinateBounds[qa]]`
Out= 