public void RotatePositionUpDown(double angle) { Matrix rotateMatrix = ModificationMatrix.GetMoveMatrix(-Target.X, -Target.Y, -Target.Z); rotateMatrix = rotateMatrix.Multiply(Position.GetProjectiveCoordinates()); Position.Set(rotateMatrix[0, 0], rotateMatrix[1, 0], rotateMatrix[2, 0]); angle += MathHelp.RadiansToDegrees(Position.Theta); angle = Math.Min(Math.Max(angle, MIN_THETA), MAX_THETA); Position.SetTheta(MathHelp.DegreesToRadians(angle)); AngleTheta = 180 - (int)angle; rotateMatrix = ModificationMatrix.GetMoveMatrix(Target.X, Target.Y, Target.Z); rotateMatrix = rotateMatrix.Multiply(Position.GetProjectiveCoordinates()); Position.Set(rotateMatrix[0, 0], rotateMatrix[1, 0], rotateMatrix[2, 0]); }
public void RotateTargetLeftRight(double angle) { Matrix rotateMatrix = ModificationMatrix.GetMoveMatrix(-Position.X, -Position.Y, -Position.Z); rotateMatrix = rotateMatrix.Multiply(Target.GetProjectiveCoordinates()); Target.Set(rotateMatrix[0, 0], rotateMatrix[1, 0], rotateMatrix[2, 0]); angle += MathHelp.RadiansToDegrees(Target.Phi); angle %= 360; angle = angle < 0 ? 360 + angle : angle; Target.SetPhi(MathHelp.DegreesToRadians(angle)); AnglePhi = (int)angle; rotateMatrix = ModificationMatrix.GetMoveMatrix(Position.X, Position.Y, Position.Z); rotateMatrix = rotateMatrix.Multiply(Target.GetProjectiveCoordinates()); Target.Set(rotateMatrix[0, 0], rotateMatrix[1, 0], rotateMatrix[2, 0]); }