public void Reposition() { X = (int)Utilities.Math.Rand(widthConstraint); Y = (int)Utilities.Math.Rand(heightConstraint); Position = new Vector(X, Y); Repositioned = true; }
// returns positive if v2 is clockwise of v1, minus if anticlockwise public int Signify(Vector v1, Vector v2) { var result = (v1.Y*v2.X > v2.X*v2.Y ? 1 : -1); return result; }
// calculates the dot product public double Dotify(Vector v1, Vector v2) { var result = v1.X*v2.X + v1.Y*v2.Y; return result; }