minus() public method

public minus ( Vec vec ) : Vec
vec Vec
return Vec
示例#1
0
 public double getInvariant(Vec p0, Vec p1)
 {
     Vec delta = p0.minus(p1);
     if (mEuklide)
         return delta.mX * delta.mX + delta.mY * delta.mY;
     else
         return -delta.mX * delta.mX + delta.mY * delta.mY;
 }
示例#2
0
文件: Line.cs 项目: Arhirat/Relative
        public override bool select(Vec pos)
        {
            Vec delta = pos.minus(mPos0);
            Vec len = mPos1.minus(mPos0);
            double proj1 = delta.dot(len) / len.lenghtSquare();
            double proj2 = delta.perp().dot(len) / len.lenghtSquare();

            return proj1 > 0 && proj1 < 1 && proj2 > -0.05 && proj2 < 0.05;
        }
示例#3
0
        public State onDown(Vec pos, MouseButtons button)
        {
            mPos = pos.minus(mShift);

            mLeft.onDown(mPos, button);
            mRight.onDown(mPos, button);

            return(this);
        }
示例#4
0
        public State onMove(Vec pos)
        {
            mPos = pos.minus(mShift);

            mLeft.onMove(mPos);
            mRight.onMove(mPos);

            return(this);
        }
示例#5
0
文件: Mouse.cs 项目: Arhirat/Relative
        public State onUp(Vec pos, MouseButtons button)
        {
            mPos = pos.minus(mShift);

            mLeft.onUp(mPos, button);
            mRight.onUp(mPos, button);

            return this;
        }
示例#6
0
文件: Mouse.cs 项目: Arhirat/Relative
        public State onMove(Vec pos)
        {
            mPos = pos.minus(mShift);

            mLeft.onMove(mPos);
            mRight.onMove(mPos);

            return this;
        }
示例#7
0
文件: Line.cs 项目: Arhirat/Relative
        override public bool select(Vec pos)
        {
            Vec    delta = pos.minus(mPos0);
            Vec    len   = mPos1.minus(mPos0);
            double proj1 = delta.dot(len) / len.lenghtSquare();
            double proj2 = delta.perp().dot(len) / len.lenghtSquare();


            return(proj1 > 0 && proj1 < 1 && proj2 > -0.05 && proj2 < 0.05);
        }
示例#8
0
        public double getInvariant(Vec p0, Vec p1)
        {
            Vec delta = p0.minus(p1);

            if (mEuklide)
            {
                return(delta.mX * delta.mX + delta.mY * delta.mY);
            }
            else
            {
                return(-delta.mX * delta.mX + delta.mY * delta.mY);
            }
        }
示例#9
0
        public Vec getCenterFromScreenAndWorld(Vec screen, Vec world)
        {
//			center = world - (mat-1) * (scale-1 * screen)
            return(world.minus(mMat.multBack(mScale.scaleBack(screen))));
        }
示例#10
0
        public Vec getScreenFromWorld(Vec world)
        {
//			screen = scale * (mat * (world - center))
            return(mScale.scale(mMat.mult(world.minus(mCenter))));
        }
示例#11
0
 public Vec getScreenFromWorld(Vec world)
 {
     //			screen = scale * (mat * (world - center))
     return mScale.scale(mMat.mult(world.minus(mCenter)));
 }
示例#12
0
 public Vec getCenterFromScreenAndWorld(Vec screen, Vec world)
 {
     //			center = world - (mat-1) * (scale-1 * screen)
     return world.minus(mMat.multBack(mScale.scaleBack(screen)));
 }
示例#13
0
        override public bool select(Vec pos)
        {
            Vec delta = pos.minus(mPos);

            return(Math.Sqrt(delta.mX * delta.mX + delta.mY * delta.mY) < 5 / mParent.mZoom);
        }
示例#14
0
文件: Point.cs 项目: Arhirat/Relative
 public override bool select(Vec pos)
 {
     Vec delta = pos.minus(mPos);
     return Math.Sqrt(delta.mX * delta.mX + delta.mY * delta.mY) < 5/mParent.mZoom;
 }