internal void DoEarthTiltRotations( ref Vector3.Vector[] InArray) { int Last = InArray.Length; for (int Count = 0; Count < Last; Count++) { Vector3.Vector Vec = InArray[Count]; Vector3.Vector ResultPoint = QuaternionEC.RotateVector3( RotationQ, InverseRotationQ, Vec); InArray[Count] = ResultPoint; } }
private void SetupEarthTiltRotations() { // RotationQ = new QuaternionEC.QuaternionRec(); // InverseRotationQ = new QuaternionEC.QuaternionRec(); double Angle = ModelConstants.EarthTiltAngleDegrees; Angle = NumbersEC.DegreesToRadians(Angle); QuaternionEC.QuaternionRec Axis; Axis.X = 1; // Rotate around the X axis. Axis.Y = 0; Axis.Z = 0; Axis.W = 0; RotationQ = QuaternionEC.SetAsRotation(Axis, Angle); InverseRotationQ = QuaternionEC.Inverse(RotationQ); }
private void MakeNorthPoleVector() { // The coordinate system is centered at the barycenter of the // solar system and the X axis goes to the point where Earth // is at the Spring Equinox. Earth is rotated around that // X axis. Vector3.Vector StraightUp; StraightUp.X = 0; StraightUp.Y = 0; StraightUp.Z = 1; QuaternionEC.QuaternionRec Axis; Axis.X = 1; // Rotate around the X axis. Axis.Y = 0; Axis.Z = 0; Axis.W = 0; NorthPoleVector = QuaternionEC.RotationWithSetupDegrees( ModelConstants.EarthTiltAngleDegrees, Axis, StraightUp); }