Exemplo n.º 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()));
        }
Exemplo n.º 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()));
        }
Exemplo n.º 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());
        }
Exemplo n.º 4
0
 public static void Add2(IVector2 a, IVector2 b, IBufferedVector2D result)
 {
     result.SetCoords(a.GetXDouble() + b.GetXDouble(), a.GetYDouble() + b.GetYDouble());
 }
Exemplo n.º 5
0
 public void Add2(IVector2 v, IBufferedVector2D result)
 {
     result.SetCoords(this.X + v.GetXDouble(), this.Y + v.GetYDouble());
 }