Exemple #1
0
 static XMatrix CreateIdentity()
 {
   XMatrix matrix = new XMatrix();
   matrix.SetMatrix(1, 0, 0, 1.0, 0, 0, XMatrixTypes.Identity);
   return matrix;
 }
Exemple #2
0
 internal static XMatrix CreateTranslation(double offsetX, double offsetY)
 {
   XMatrix matrix = new XMatrix();
   matrix.SetMatrix(1, 0, 0, 1, offsetX, offsetY, XMatrixTypes.Translation);
   return matrix;
 }
Exemple #3
0
 internal static XMatrix CreateSkewRadians(double skewX, double skewY)
 {
   XMatrix matrix = new XMatrix();
   matrix.SetMatrix(1, Math.Tan(skewY), Math.Tan(skewX), 1, 0, 0, XMatrixTypes.Unknown);
   return matrix;
 }
Exemple #4
0
 internal static XMatrix CreateScaling(double scaleX, double scaleY)
 {
   XMatrix matrix = new XMatrix();
   matrix.SetMatrix(scaleX, 0, 0, scaleY, 0, 0, XMatrixTypes.Scaling);
   return matrix;
 }
Exemple #5
0
 internal static XMatrix CreateScaling(double scaleX, double scaleY, double centerX, double centerY)
 {
   XMatrix matrix = new XMatrix();
   matrix.SetMatrix(scaleX, 0, 0, scaleY, centerX - scaleX * centerX, centerY - scaleY * centerY, XMatrixTypes.Scaling | XMatrixTypes.Translation);
   return matrix;
 }
Exemple #6
0
 internal static XMatrix CreateRotationRadians(double angle, double centerX, double centerY)
 {
   XMatrix matrix = new XMatrix();
   double sin = Math.Sin(angle);
   double cos = Math.Cos(angle);
   double offsetX = (centerX * (1.0 - cos)) + (centerY * sin);
   double offsetY = (centerY * (1.0 - cos)) - (centerX * sin);
   matrix.SetMatrix(cos, sin, -sin, cos, offsetX, offsetY, XMatrixTypes.Unknown);
   return matrix;
 }