/* * 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)); }
/* * 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()); }