DME Component Libraries for .NET 2024 r2

## SphericalHarmonicCoefficients Constructor (Double, Double, Double) |

Initializes a new instance from the provided coefficients. Degree and order are inferred from the shapes of the coefficient arrays.

Syntax

public SphericalHarmonicCoefficients( double[] zonalCoefficients, double[][] cosineCoefficients, double[][] sineCoefficients )

- zonalCoefficients
- Type: SystemDouble

The zonal coefficients (J2 = -C20, J3 = -C30, etc.). - cosineCoefficients
- Type: SystemDouble

The cosine coefficients (C21, C22, C31, etc.). - sineCoefficients
- Type: SystemDouble

The sine coefficients (S21, S22, S31, etc.).

Exceptions

Exception | Condition |
---|---|

ArgumentNullException | Thrown when zonalCoefficients, cosineCoefficients, or sineCoefficients are null. |

ArgumentException | Thrown when the input coefficient arrays have inconsistent sizes or shapes with each other or with the inferred degree and order of the field. |

Remarks

An consistent field of degree 2 and order 0 would be inferred from a zonalCoefficients array that is size double[3] with cosineCoefficients array that is size double[3][] with cosineCoefficients[0] a double[1], cosineCoefficients[1] a double[1], and cosineCoefficients[2] a double[1]. The sineCoefficients array must be the same size and shape as the cosineCoefficients array. All of the values inside the cosine and sine coefficient arrays should be 0.0 if the order is 0, but this is not enforced. The cosine coefficients are 0.0 because the zonal coefficients incorporate the order 0 terms as J2 = -C20, J3 = -C30, etc. The sine coefficients S20, S30, etc. are 0.0 by definition.

A consistent field of degree 2 and order 1 would be inferred from a zonalCoefficients array that is size double[3] with cosineCoefficients array that is size double[3][] with cosineCoefficients[0] a double[1], cosineCoefficients[1] a double[2], and cosineCoefficients[2] a double[2]. The sineCoefficients array must be the same size and shape as the cosineCoefficients array. Any field with degree greater than 2 and order 1 would have any cosineCoefficients[3] and higher as double[2] as well. The order 0 terms of the cosine and sine arrays should be 0.0 (e.g. sineCoefficients[2][0] == 0.0), but the higher-order terms are typically non-zero (e.g. cosineCoefficients[2][1] != 0.0).

A consistent field of degree and order 2 would be inferred from a zonalCoefficients array that is size double[3] with cosineCoefficients array that is size double[3][] with cosineCoefficients[0] a double[1], cosineCoefficients[1] a double[2], and cosineCoefficients[2] a double[3]. The sineCoefficients array must be the same size and shape as the cosineCoefficients array. Any field with equal degrees and orders would have linearly increasing sizes of the inner double arrays. For example, a gravity field of degree and order 3 would have its cosineCoefficient[3] a double[4].

See Also