public static Matrix CalculateEulerElementMatrix(OrientationParameter angles) { double tempOmegaCos = angles.Omega.Cos; double tempOmegaSin = angles.Omega.Sin; double tempPhiCos = angles.Phi.Cos; double tempPhiSin = angles.Phi.Sin; double tempKappaCos = angles.Kappa.Cos; double tempKappaSin = angles.Kappa.Sin; return(new Matrix(new double[][] { new double[] { tempPhiCos *tempKappaCos, -tempPhiCos *tempKappaSin, tempPhiSin }, new double[] { tempOmegaCos *tempKappaSin + tempOmegaSin *tempPhiSin *tempKappaCos, tempOmegaCos *tempKappaCos - tempOmegaSin *tempPhiSin *tempKappaSin, -tempOmegaSin *tempPhiCos }, new double[] { tempOmegaSin *tempKappaSin - tempOmegaCos *tempPhiSin *tempKappaCos, tempOmegaSin *tempKappaCos + tempOmegaCos *tempPhiSin *tempKappaSin, tempOmegaCos *tempPhiCos } })); }
public Ellipsoid(string name, LinearUnit semiMajorAxis, LinearUnit semiMinorAxis, ICartesian3DPoint datumTranslation, OrientationParameter datumMisalignment, int srid) : this(name, semiMajorAxis, 1.0 / ((semiMajorAxis.Subtract(semiMinorAxis)).Divide(semiMajorAxis)).Value, datumTranslation, datumMisalignment, srid) { }
public Ellipsoid(string name, LinearUnit semiMajorAxis, double inverseFlattening, ICartesian3DPoint datumTranslation, OrientationParameter datumMisalignment, int srid) { this._datumTranslation = new Cartesian3DPoint <TLinear>(datumTranslation.X, datumTranslation.Y, datumTranslation.Z); this._datumMisalignment = new OrientationParameter(datumMisalignment.Omega.ChangeTo <TAngular>(), datumMisalignment.Phi.ChangeTo <TAngular>(), datumMisalignment.Kappa.ChangeTo <TAngular>()); this._name = name; this._srid = srid; this._semiMajorAxis = semiMajorAxis.ChangeTo <TLinear>(); double tempSemiMajor = this._semiMajorAxis.Value; if (inverseFlattening == 0) { this._semiMinorAxis = new TLinear() { Value = tempSemiMajor }; } else { this._semiMinorAxis = new TLinear() { Value = tempSemiMajor - tempSemiMajor / inverseFlattening }; } double tempSemiMinor = this._semiMinorAxis.Value; this._firstEccentricity = Math.Sqrt((tempSemiMajor * tempSemiMajor - tempSemiMinor * tempSemiMinor) / (tempSemiMajor * tempSemiMajor)); this._secondEccentricity = Math.Sqrt((tempSemiMajor * tempSemiMajor - tempSemiMinor * tempSemiMinor) / (tempSemiMinor * tempSemiMinor)); this.EsriName = string.Empty; }