/// <summary> /// Constructor with a subset of coefficients specified. /// </summary> /// <param name="coeff0">A <see cref="SphericalEngine.Coeff"/> object containing <i>Cnm</i> and <i>Snm</i> coefficients.</param> /// <param name="coeff1">A <see cref="SphericalEngine.Coeff"/> object containing <i>C'nm</i> and <i>S'nm</i> coefficients.</param> /// <param name="a">the reference radius appearing in the definition of the sum.</param> /// <param name="norm">the normalization for the associated Legendre polynomials, /// either <see cref="Normalization.Full"/> (the default) or <see cref="Normalization.Schmidt"/>.</param> /// <remarks>See <see cref="SphericalHarmonic"/> for the way the coefficients should be stored.</remarks> public SphericalHarmonic1(SphericalEngine.Coeff coeff0, SphericalEngine.Coeff coeff1, double a, Normalization norm = Normalization.Full) { _a = a; _norm = norm; if (!(coeff1.N <= coeff0.N)) { throw new GeographicException("N1 cannot be larger that N"); } if (!(coeff1.Nmx <= coeff0.Nmx)) { throw new GeographicException("nmx1 cannot be larger that nmx"); } if (!(coeff1.Mmx <= coeff0.Mmx)) { throw new GeographicException("mmx1 cannot be larger that mmx"); } _c = new[] { coeff0, coeff1 }; }
/// <summary> /// Constructor with a subset of coefficients specified. /// </summary> /// <param name="coeff">A <see cref="SphericalEngine.Coeff"/> object containing <i>Cnm</i> and <i>Snm</i> coefficients.</param> /// <param name="a">the reference radius appearing in the definition of the sum.</param> /// <param name="norm">the normalization for the associated Legendre polynomials, /// either <see cref="Normalization.Full"/> (the default) or <see cref="Normalization.Schmidt"/>.</param> public SphericalHarmonic(SphericalEngine.Coeff coeff, double a, Normalization norm = Normalization.Full) { _a = a; _norm = norm; _c = new[] { coeff }; }