Exemplo n.º 1
0
 public void set(pointnD pnt)
 {
     l2_norm    = pnt.l2_norm;
     cordinates = new double[pnt.cordinates.Count()];
     for (int i = 0; i < pnt.cordinates.Count(); i++)
     {
         cordinates[i] = pnt.cordinates[i];
     }
 }
Exemplo n.º 2
0
        public pointnD minus(pointnD pnt)
        {
            pointnD out_pnt = new pointnD();

            for (int i = 0; i < pnt.cordinates.Count(); i++)
            {
                out_pnt.cordinates[i] = cordinates[i] - pnt.cordinates[i];
            }
            return(out_pnt);
        }
Exemplo n.º 3
0
        public static double dot(pointnD pnt1, pointnD pnt2)
        {
            double norm1 = pnt1.l2_norm_calc();
            double norm2 = pnt2.l2_norm_calc();
            double sum2  = 0;

            for (int i = 0; i < pnt1.cordinates.Count(); i++)
            {
                sum2 += pnt1.cordinates[i] * pnt2.cordinates[i] / (norm1 * norm2);
            }
            return(sum2);
        }