private void computeXY( Projector hp, Projector vp, Transcaler ts, int n, float[] x1, float[] x2, int[] x, int[] y) { ts = ts.combineWith(hp,vp); float[] xv = null; float[] yv = null; if (_orientation==Orientation.X1RIGHT_X2UP) { xv = x1; yv = x2; } else if (_orientation==Orientation.X1DOWN_X2RIGHT) { xv = x2; yv = x1; } double hLeft = Math.min(hp.v0(),hp.v1()); double vBot = Math.min(vp.v0(),vp.v1()); for (int i=0; i<n; ++i) { x[i] = ts.x((xv[i]<=0 && hp.getScale()==AxisScale.LOG10)?hLeft:xv[i]); y[i] = ts.y((yv[i]<=0 && vp.getScale()==AxisScale.LOG10)?vBot:yv[i]); } }
private static void assertVeryClose (Projector expected, Projector actual) { boolean success = true; success &= Math.abs(expected.u0()-actual.u0()) <= eps; success &= Math.abs(expected.u1()-actual.u1()) <= eps; success &= Math.abs(expected.v0()-actual.v0()) <= eps; success &= Math.abs(expected.v1()-actual.v1()) <= eps; if (!success) fail("Expected: <"+expected+"> but was:<"+actual+">"); }
/** * Sets limits for the vertical axis. * By default, limits are computed automatically by tiled graphical views. * This method can be used to override those default limits. * @param vmin the minimum value. * @param vmax the maximum value. */ public void setVLimits(double vmin, double vmax) { Check.argument(vmin<vmax,"vmin<vmax"); if(_bvp!=null && _bvp.isLog()) Check.argument(vmin>0,"vmin>0 for LOG scales"); if(_bvp.v0()<_bvp.v1()) _svp = new Projector(vmin,vmax); else _svp = new Projector(vmax,vmin); alignProjectors(); }