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 ICartesian3D Shift(ICartesian3DPoint newBase) { double tempX = (newBase.X.ChangeTo <T>()).Value; double tempY = (newBase.Y.ChangeTo <T>()).Value; double tempZ = (newBase.Z.ChangeTo <T>()).Value; ILinearCollection newX = X.SubtractAllValuesWith(tempX); ILinearCollection newY = Y.SubtractAllValuesWith(tempY); ILinearCollection newZ = Z.SubtractAllValuesWith(tempZ); return(new Cartesian3D <T>(newX, newY, newZ, this.Handedness)); }
public ICartesian3D Transform(Matrix rotation, ICartesian3DPoint translation, AxisType newHandedness) { if (rotation.NumberOfColumns != 3) { throw new NotImplementedException(); } if (rotation.NumberOfRows != 3) { throw new NotImplementedException(); } double tempX = (translation.X.ChangeTo <T>()).Value; double tempY = (translation.Y.ChangeTo <T>()).Value; double tempZ = (translation.Z.ChangeTo <T>()).Value; LinearCollection <T> x = new LinearCollection <T>(this.NumberOfPoints); LinearCollection <T> y = new LinearCollection <T>(this.NumberOfPoints); LinearCollection <T> z = new LinearCollection <T>(this.NumberOfPoints); for (int i = 0; i < this.NumberOfPoints; i++) { Matrix tempMatrix = new Matrix(new double[][] { new double[] { this.X.GetTheValue(i), this.Y.GetTheValue(i), this.Z.GetTheValue(i) } }); Matrix result = rotation * tempMatrix; x.SetTheValue(i, result[0, 0] - tempX); y.SetTheValue(i, result[1, 0] - tempY); z.SetTheValue(i, result[2, 0] - tempZ); } return(new Cartesian3D <T>(x, y, z, newHandedness)); }
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; }
public ICartesian3D Transform(Matrix rotation, ICartesian3DPoint translation) { return(this.Transform(rotation, translation, this.Handedness)); }
public ICartesian3D Transform(AngularUnit rotationAboutX, AngularUnit rotationAboutY, AngularUnit rotationAboutZ, ICartesian3DPoint translation) { Matrix rotationMatrix = Transformation.CalculateEulerElementMatrix( new OrientationParameter(rotationAboutX, rotationAboutY, rotationAboutZ)); return(this.Transform(rotationMatrix, translation, this.Handedness)); }