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; }
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; }
public State onDown(Vec pos, MouseButtons button) { mPos = pos.minus(mShift); mLeft.onDown(mPos, button); mRight.onDown(mPos, button); return(this); }
public State onMove(Vec pos) { mPos = pos.minus(mShift); mLeft.onMove(mPos); mRight.onMove(mPos); return(this); }
public State onUp(Vec pos, MouseButtons button) { mPos = pos.minus(mShift); mLeft.onUp(mPos, button); mRight.onUp(mPos, button); return this; }
public State onMove(Vec pos) { mPos = pos.minus(mShift); mLeft.onMove(mPos); mRight.onMove(mPos); return this; }
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); }
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); } }
public Vec getCenterFromScreenAndWorld(Vec screen, Vec world) { // center = world - (mat-1) * (scale-1 * screen) return(world.minus(mMat.multBack(mScale.scaleBack(screen)))); }
public Vec getScreenFromWorld(Vec world) { // screen = scale * (mat * (world - center)) return(mScale.scale(mMat.mult(world.minus(mCenter)))); }
public Vec getScreenFromWorld(Vec world) { // screen = scale * (mat * (world - center)) return mScale.scale(mMat.mult(world.minus(mCenter))); }
public Vec getCenterFromScreenAndWorld(Vec screen, Vec world) { // center = world - (mat-1) * (scale-1 * screen) return world.minus(mMat.multBack(mScale.scaleBack(screen))); }
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); }
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; }