# oblateSpheroid

Oblate ellipsoid of revolution

## Description

An `oblateSpheroid` object encapsulates the interrelated intrinsic properties of an oblate ellipsoid of revolution. An oblate spheroid is symmetric about its polar axis and flattened at the poles, and includes the perfect sphere as a special case.

## Creation

You can create an `oblateSpheroid` object, `s`, by entering:

`s = oblateSpheroid;`
on the command line.

## Properties

expand all

Equatorial radius of spheroid, specified as a positive, finite scalar. The value of `SemimajorAxis` is expressed in meters.

When the `SemimajorAxis` property is changed, the `SemiminorAxis` property scales as needed to preserve the shape of the spheroid and the values of shape-related properties including `InverseFlattening` and `Eccentricity`. The only way to change the `SemimajorAxis` property is to set it directly, using dot notation.

Example: 6378137

Data Types: `double`

Distance from center of spheroid to pole, specified as a nonnegative, finite scalar. The value of `SemiminorAxis` is always less than or equal to `SemimajorAxis`, and is expressed in meters.

When the `SemiminorAxis` property is changed, the `SemimajorAxis` property remains unchanged, but the shape of the spheroid changes, which is reflected in changes in the values of `InverseFlattening`, `Eccentricity`, and other shape-related properties.

Example: 6356752

Data Types: `double`

Reciprocal of flattening, specified as positive scalar in the range [1, `Inf`].

The value of inverse flattening, 1/f, is calculated using `SemimajorAxis` value a and `SemiminorAxis` value b according to 1/f = a/(a-b). A value 1/f of `Inf` designates a perfect sphere. As 1/f approaches 1, the reference spheroid approaches a flattened disk.

When the `InverseFlattening` property is changed, other shape-related properties update, including `Eccentricity`. The `SemimajorAxis` property remains unchanged, but the value of `SemiminorAxis` adjusts to reflect the new shape.

Example: 300

Data Types: `double`

First eccentricity of the spheroid, specified as nonnegative scalar in the range [0, 1].

The value of eccentricity, ecc, is calculated using `SemimajorAxis` value a and `SemiminorAxis` value b according to ecc = `sqrt`(a2 - b2)/a. A value ecc of 0 designates a perfect sphere.

When the `Eccentricity` property is changed, other shape-related properties update, including `InverseFlattening`. The `SemimajorAxis` property remains unchanged, but the value of `SemiminorAxis` adjusts to reflect the new shape.

Example: 0.08

Data Types: `double`

Flattening of the spheroid, specified as nonnegative scalar in the range [0, 1].

The value of flattening, f, is calculated using `SemimajorAxis` value a and `SemiminorAxis` value b according to f = (a-b)/a.

Data Types: `double`

Third flattening of the spheroid, specified as nonnegative scalar in the range [0, 1].

The value of the third flattening, n, is calculated using `SemimajorAxis` value a and `SemiminorAxis` value b according to n = (a-b)/(a+b).

Data Types: `double`

Mean radius of the spheroid, specified as positive, finite scalar. The `MeanRadius` property is expressed in meters.

The mean radius of the spheroid, r, is calculated using `SemimajorAxis` value a and `SemiminorAxis` value b according to r = (2a+b)/3.

Data Types: `double`

Surface area of the spheroid, specified as positive, finite scalar. The `SurfaceArea` property is expressed in square meters.

Data Types: `double`

Volume of the spheroid, specified as positive, finite scalar. The `Volume` property is expressed in cubic meters.

Data Types: `double`

## Examples

collapse all

Create a GRS 80 ellipsoid using the `oblateSpheroid` class.

```s = oblateSpheroid ```
```s = oblateSpheroid with defining properties: SemimajorAxis: 1 SemiminorAxis: 1 InverseFlattening: Inf Eccentricity: 0 and additional properties: Flattening ThirdFlattening MeanRadius SurfaceArea Volume```

Reset the semimajor axis to match the equatorial radius of the GRS 80 reference ellipsoid.

```s.SemimajorAxis = 6378137 ```
```s = oblateSpheroid with defining properties: SemimajorAxis: 6378137 SemiminorAxis: 6378137 InverseFlattening: Inf Eccentricity: 0 and additional properties: Flattening ThirdFlattening MeanRadius SurfaceArea Volume```

The result is a sphere with radius 6,378,137 meters.

Reset the inverse flattening to the standard value for GRS 80, resulting in an oblate spheroid with a semiminor axis consistent with the value, 6,356,752.3141, tabulated in DMA Technical Memorandum 8358.1, "Datums, Ellipsoids, Grids, and Grid Reference Systems."

```s.InverseFlattening = 298.257222101 ```
```s = oblateSpheroid with defining properties: SemimajorAxis: 6378137 SemiminorAxis: 6356752.31414036 InverseFlattening: 298.257222101 Eccentricity: 0.0818191910428158 and additional properties: Flattening ThirdFlattening MeanRadius SurfaceArea Volume ```

## Tips

• When you define a spheroid in terms of semimajor and semiminor axes (rather than semimajor axis and inverse flattening, or semimajor axis and eccentricity), a small loss of precision in the last few digits of `Flattening`, `Eccentricity`, and `ThirdFlattening` may occur. This is unavoidable, but does not affect the results of practical computation.

## Extended Capabilities

### C/C++ Code GenerationGenerate C and C++ code using MATLAB® Coder™. 