referenceSphere

Reference ellipsoid

Description

A referenceSphere object represents a sphere with a specific name and radius that you can use in map projections and other geodetic operations.

Creation

Description

S = referenceSphere creates a referenceSphere object that represents the unit sphere.

example

S = referenceSphere(name) creates a referenceSphere object corresponding to the specified spherical body given by name. The radius of the reference sphere is in meters.

S = referenceSphere(name,lengthUnit) creates a referenceSphere object with radius in the specified unit of length, LengthUnit. The unit of length can be any length unit supported by the validateLengthUnit function.

Properties

expand all

Name of the reference sphere, specified as a string scalar or character vector. Supported names of spherical bodies are: 'earth', 'sun', 'moon', 'mercury', 'venus', 'mars', 'jupiter', 'saturn', 'uranus','neptune', and 'pluto'. When the reference sphere represents the unit sphere, Name is the character vector 'Unit Sphere'.

Example: 'Sun'

Data Types: char | string

Unit of length of the radius, specified as a string scalar or character vector. You can specify any unit of length accepted by the validateLengthUnit function. When the reference ellipsoid represents the unit sphere, LengthUnit is the empty character vector ''.

Example: 'km'

Data Types: char | string

Radius of the sphere, specified as positive, finite scalar.

Data Types: double

This property is read-only.

Equatorial radius of the sphere, specified as a positive, finite scalar. The value of SemimajorAxis is equal to the value of Radius.

Data Types: double

This property is read-only.

Distance from center of sphere to pole, specified as a positive, finite scalar. The value of SemiminorAxis is equal to the value of Radius.

Data Types: double

This property is read-only.

Reciprocal of flattening, specified as the value Inf.

Data Types: double

This property is read-only.

First eccentricity of the sphere, specified as the value 0.

Data Types: double

This property is read-only.

Flattening of the sphere, specified as the value 0.

Data Types: double

This property is read-only.

Third flattening of the sphere, specified as the value 0.

Data Types: double

This property is read-only.

Mean radius of the sphere, specified as positive, finite scalar. The value of MeanRadius is equal to the value of Radius.

Data Types: double

This property is read-only.

Surface area of the sphere, specified as positive, finite scalar.

The SurfaceArea property is expressed in units of area consistent with the unit of length specified by the LengthUnit property.

Data Types: double

This property is read-only.

Volume of the sphere, specified as positive, finite scalar.

The Volume property is expressed in units of volume consistent with the unit of length specified by the LengthUnit property.

Data Types: double

Examples

collapse all

Construct a reference sphere that models the Earth as a sphere with a radius of 6371000 meters. Note that the unit of length is meters.

s = referenceSphere('Earth')
s = 

referenceSphere with defining properties:

          Name: 'Earth'
    LengthUnit: 'meter'
        Radius: 6371000

  and additional properties:

    SemimajorAxis
    SemiminorAxis
    InverseFlattening
    Eccentricity
    Flattening
    ThirdFlattening
    MeanRadius
    SurfaceArea
    Volume

Switch the unit of length in the reference sphere to kilometers.

s.LengthUnit = 'kilometer'
s = 

referenceSphere with defining properties:

          Name: 'Earth'
    LengthUnit: 'kilometer'
        Radius: 6371

  and additional properties:

    SemimajorAxis
    SemiminorAxis
    InverseFlattening
    Eccentricity
    Flattening
    ThirdFlattening
    MeanRadius
    SurfaceArea
    Volume

Determine the surface area of the sphere in square kilometers.

s.SurfaceArea
ans =

   5.1006e+08

Find the volume of the sphere in cubic kilometers.

s.Volume
ans =

   1.0832e+12

Introduced in R2012a