Пример #1
0
 /// <summary>
 /// Cartesian constructor
 /// </summary>
 public Vector2D(double x, double y)
 {
     if (!UtilityFunctions.IsValid(x) || !UtilityFunctions.IsValid(y))
     {
         throw new ArgumentException("Attempted to pass infinity or not-a-number to Vector2D class!");
     }
     X = x;
     Y = y;
 }
Пример #2
0
        /// <summary>
        /// Cartesian constructor
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="z"></param>
        public Vector(double x, double y, double z)
        {
            if (!UtilityFunctions.IsValid(x) || !UtilityFunctions.IsValid(y) || !UtilityFunctions.IsValid(z))
            {
                throw new ArgumentException("Attempted to pass infinity or not-a-number to Vector class!");
            }

            this.X = x;
            this.Y = y;
            this.Z = z;
        }