예제 #1
0
 public override List <MyPoint> UpdatePoints(int div)
 {
     Points.Clear();
     betaShift = 360 / (double)div;
     alfaShift = 360 / (double)div;
     for (int i = 0; i < div; i++)
     {
         for (int j = 0; j < div; j++)
         {
             Points.Add(new MyPoint((R + r * (double)Math.Cos(MyMath.Deg((j * betaShift)))) * (double)Math.Cos(MyMath.Deg((i * alfaShift))), (R + r * (double)Math.Cos(MyMath.Deg((j * betaShift)))) * (double)Math.Sin(MyMath.Deg((i * alfaShift))), r * (double)Math.Sin(MyMath.Deg((j * betaShift)))));
             Points.Last().Multiply(10);
         }
     }
     return(Points);
 }
예제 #2
0
        public double[][] CreateRotateXMatrix(double deg)
        {
            double angle = MyMath.Deg(deg);

            var result = new double[4][];

            for (int i = 0; i < 4; i++)
            {
                result[i] = new double[4];
            }

            result[0][0] = result[3][3] = 1;
            result[1][1] = result[2][2] = (double)Math.Cos(angle);
            result[1][2] = (double)-Math.Sin(angle);
            result[2][1] = (double)Math.Sin(angle);

            return(result);
        }