Ejemplo n.º 1
0
        public void Transform(Matrix3 m, OnlineMonitor form1, ChartStyle cs)
        {
            // Normalize the point:初始化点
            float x1 = (X - cs.XMin) / (cs.XMax - cs.XMin) - 0.5f;
            float y1 = (Y - cs.YMin) / (cs.YMax - cs.YMin) - 0.5f;
            float z1 = (Z - cs.ZMin) / (cs.ZMax - cs.ZMin) - 0.5f;

            // Perform transformation on the point using matrix m:用矩阵m 完成点的转换
            float[] result = m.VectorMultiply(new float[4] {
                x1, y1, z1, W
            });
            X = result[0];
            Y = result[1];
            // Coordinate transformation from World to Device system:
            float xShift = 1.05f;
            float xScale = 1;
            float yShift = 1.05f;
            float yScale = 0.9f;

            if (cs.Title == "No Title")
            {
                yShift = 0.95f;
                yScale = 1;
            }
            if (cs.IsColorBar)
            {
                xShift = 0.95f;
                xScale = 0.9f;
            }
            X = (xShift + xScale * X) * form1.PlotPanel.Width / 2;
            Y = (yShift - yScale * Y) * form1.PlotPanel.Height / 2;
        }
Ejemplo n.º 2
0
 public void Transform(Matrix3 m)
 {
     float[] result = m.VectorMultiply(new float[4] {
         X, Y, Z, W
     });
     X = result[0];
     Y = result[1];
     Z = result[2];
     W = result[3];
 }