Ejemplo n.º 1
0
 /*
  * Returns true if the Vector2D is parallel to this instance.
  */
 public bool IsParallel(Vektor2D vector)
 {
     if (this.Normalize() == vector.Normalize())
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
        /*
         * Function which returns the angle between to instances of Vector2D.
         */
        public double GetAngleBetween(Vektor2D b)
        {
            double hyp1 = this.GetLength();
            double ank1 = this.x;

            double hyp2 = b.GetLength();
            double ank2 = b.X;

            return(Math.Acos(ank1 / hyp1) - Math.Acos(ank2 / hyp2));
        }
Ejemplo n.º 3
0
        /*
         * Function to which calculates the Distance, between this instance and another Vektor2D, as a double.
         */
        public double GetDistance(Vektor2D point)
        {
            Vektor2D vector = new Vektor2D(this.x - point.X, this.y - point.Y);

            return(vector.GetLength());
        }