Пример #1
0
        public IVector2 Sub(IVector2 v)
        {
            BufferedVector2d bv = v as BufferedVector2d;

            if (bv != null)
            {
                return(new BufferedVector2d(this.X - bv.X, this.Y - bv.Y));
            }
            Vector2d sv = v as Vector2d;

            if (sv != null)
            {
                return(new BufferedVector2d(this.X - sv.x, this.Y - sv.y));
            }
            return(new BufferedVector2d(this.X - v.GetXDouble(), this.Y - v.GetYDouble()));
        }
Пример #2
0
        public IVector2 Add(IVector2 v)
        {
            BufferedVector2d bv = v as BufferedVector2d;

            if (bv != null)
            {
                return(new BufferedVector2d(this.X + bv.X, this.Y + bv.Y));
            }
            Vector2d sv = v as Vector2d;

            if (sv != null)
            {
                return(new BufferedVector2d(this.X + sv.x, this.Y + sv.y));
            }
            return(new BufferedVector2d(this.X + v.GetXDouble(), this.Y + v.GetYDouble()));
        }
Пример #3
0
        public void Sub(IVector2 v, IBufferedVector2D result)
        {
            BufferedVector2d bv = v as BufferedVector2d;

            if (bv != null)
            {
                result.SetCoords(this.X - bv.X, this.Y - bv.Y);
                return;
            }
            Vector2d sv = v as Vector2d;

            if (sv != null)
            {
                result.SetCoords(this.X - sv.x, this.Y - sv.y);
                return;
            }
            result.SetCoords(this.X - v.GetXDouble(), this.Y - v.GetYDouble());
        }
Пример #4
0
 public void Sub(BufferedVector2d v)
 {
     this.Set(this.X - v.X, this.Y - v.Y);
 }
Пример #5
0
 public void Add(BufferedVector2d v)
 {
     this.Set(this.X + v.X, this.Y + v.Y);
 }