Пример #1
0
 /// <summary>
 ///     Calcula la transformacion que permite que el rectangulo <c>rec</c> se centre en el punto
 ///     <c>punto</c>.
 /// </summary>
 /// <param name="orig">Rectangulo.</param>
 /// <param name="punto">Posicion.</param>
 public static Matrix3x3d Center(Rectangle2d orig, Point2d punto)
 {
     // Calcula la transformacion.
     return(Matrix3x3dUtils.Translate(
                punto.X - orig.X - orig.DY / 2,
                punto.Y - orig.Y - orig.DY / 2));
 }
Пример #2
0
        public static Matrix4x4d RotateQuat(double x, double y, double z, double w)
        {
            Matrix3x3d m = Matrix3x3dUtils.RotateQuat(x, y, z, w);

            return(new Matrix4x4d(
                       m.M00, m.M01, m.M02, 0,
                       m.M10, m.M11, m.M12, 0,
                       m.M20, m.M21, m.M22, 0,
                       0, 0, 0, 1));
        }
Пример #3
0
        /// this conversion uses NASA standard aeroplane conventions as described on page:
        /// http://www.euclideanspace.com/maths/geometry/rotations/euler/index.htm
        /// Coordinate System: right hand
        /// Positive angle: right hand
        /// Order of euler angles: heading first, then attitude, then bank
        /// matrix row column ordering:
        /// [m00 m01 m02 0]
        /// [m10 m11 m12 0]
        /// [m20 m21 m22 0]
        /// [0   0   0   1]
        public static Matrix4x4d RotateEuler(double heading, double attitude, double bank)
        {
            Matrix3x3d m = Matrix3x3dUtils.RotateEuler(heading, attitude, bank);

            return(new Matrix4x4d(
                       m.M00, m.M01, m.M02, 0,
                       m.M10, m.M11, m.M12, 0,
                       m.M20, m.M21, m.M22, 0,
                       0, 0, 0, 1));
        }