# geod2geoc

Convert geodetic latitude to geocentric latitude

## Syntax

`gc = geod2geoc(gd, h)gc = geod2geoc(gd, h, model)gc = geod2geoc(gd, h, f, Re)`

## Description

`gc = geod2geoc(gd, h)` converts an array of `m` geodetic latitudes, `gd`, and an array of mean sea level altitudes, `h`, into an array of `m` geocentric latitudes, `gc`. `h` is in meters. Latitude values can be any value. However, values of +90 and -90 may return unexpected values because of singularity at the poles.

`gc = geod2geoc(gd, h, model)` is an alternate method for converting from geodetic to geocentric latitude for a specific ellipsoid planet. Currently only `'WGS84'` is supported for `model`. Latitude values can be any value. However, values of +90 and -90 may return unexpected values because of singularity at the poles.

`gc = geod2geoc(gd, h, f, Re)` is another alternate method for converting from geodetic to geocentric latitude for a custom ellipsoid planet defined by flattening, `f`, and the equatorial radius, `Re`, in meters. Latitude values can be any value. However, values of +90 and -90 may return unexpected values because of singularity at the poles.

## Examples

Determine geocentric latitude given a geodetic latitude and altitude:

```gc = geod2geoc(45, 1000) gc = 44.8076 ```

Determine geocentric latitude at multiple geodetic latitudes and altitudes, specifying WGS84 ellipsoid model:

```gc = geod2geoc([0 45 90], [1000 0 2000], 'WGS84') gc = 0 44.8076 90.0000```

Determine geocentric latitude at multiple geodetic latitudes, given an altitude and specifying custom ellipsoid model:

```f = 1/196.877360; Re = 3397000; gc = geod2geoc([0 45 90], 2000, f, Re) gc = 0 44.7084 90.0000```

## Assumptions and Limitations

This implementation generates a geocentric latitude that lies between ±90 degrees.

## References

Stevens, B. L., and F. L. Lewis, Aircraft Control and Simulation, John Wiley & Sons, New York, NY, 1992