Exemplo n.º 1
0
        public PointN(PointN other)
        {
            int dimensionsCount = other.Coordinates.Count;

            Coordinates = new List <double>(dimensionsCount);
            for (int i = 0; i < dimensionsCount; i++)
            {
                Coordinates.Add(other.Coordinates[i]);
            }
        }
Exemplo n.º 2
0
        public static PointN operator *(PointN multiplicand, double multiplier)
        {
            int    dimensionsCount = multiplicand.Coordinates.Count;
            PointN composition     = new PointN(dimensionsCount);

            for (int i = 0; i < dimensionsCount; i++)
            {
                composition.Coordinates[i] = multiplicand.Coordinates[i] * multiplier;
            }

            return(composition);
        }
Exemplo n.º 3
0
        public static PointN operator -(PointN a, PointN b)
        {
            int    dimensionsCount = a.Coordinates.Count;
            PointN c = new PointN(dimensionsCount);

            for (int i = 0; i < dimensionsCount; i++)
            {
                c.Coordinates[i] = a.Coordinates[i] - b.Coordinates[i];
            }

            return(c);
        }
Exemplo n.º 4
0
        public static PointN operator -(PointN point, VectorN vector)
        {
            int    dimensionsCount = point.Coordinates.Count;
            PointN resultPoint     = new PointN(dimensionsCount);

            for (int i = 0; i < dimensionsCount; i++)
            {
                resultPoint.Coordinates[i] = point.Coordinates[i] - vector.Components[i];
            }

            return(resultPoint);
        }
Exemplo n.º 5
0
 public double Value(PointN point)
 {
     return(m_function(point));
 }