Exemplo n.º 1
0
        public bool Equals(Vector2D v)
        {
            if ((object)v == null)
            {
                return false;
            }

            return this.x == v.x && this.y == v.y;
        }
Exemplo n.º 2
0
        public static Vector2D Rotate(Vector2D v, double a)
        {
            double x = Math.Cos(a) * v.x - Math.Sin(a) * v.y;
            double y = Math.Sin(a) * v.x + Math.Cos(a) * v.y;

            return new Vector2D(x, y);
        }