public void testProjectionLog () { Projector p = new Projector(0.1, 100, 0.0, 1.0, AxisScale.LOG10); assertVeryClose(0.1, p.v(p.u(0.1))); assertVeryClose(2, p.v(p.u(2))); assertVeryClose(56.7785, p.v(p.u(56.7785))); assertVeryClose(0.0, p.u(p.v(0.0))); assertVeryClose(0.25, p.u(p.v(0.25))); assertVeryClose(0.6173, p.u(p.v(0.6173))); }
int xf = ts.x(hp.u(fx)); int xl = ts.x(hp.u(lx)); int x1 = min(xf,xl)-rb; int x2 = max(xf,xl)+rb; int y0 = ts.y(vp.u(0.0)); g2d.drawLine(x1,y0,x2,y0); double xi = fx+ix*dx; double fi = _f[ix]; int x = ts.x(hp.u(xi)); int y = ts.y(vp.u(fi)); g2d.drawLine(x,y0,x,y); g2d.fillOval(x-rb,y-rb,1+2*rb,1+2*rb);
int y = ts.y(vp.u(0.0)); g2d.drawLine(0,y,w-1,y); } else if (_horizontal==Horizontal.MAJOR && axisLeftRight!=null) { for (int itic=0; itic<nticMajor; ++itic) { double vtic = fticMajor+itic*dticMajor; double utic = vp.u(vtic); int y = ts.y(utic); g2d.drawLine(0,y,w-1,y); int x = ts.x(hp.u(0.0)); g2d.drawLine(x,0,x,h-1); } else if (_vertical==Vertical.MAJOR && axisTopBottom!=null) { for (int itic=0; itic<nticMajor; ++itic) { double vtic = fticMajor+itic*dticMajor; double utic = hp.u(vtic); int x = ts.x(utic); g2d.drawLine(x,0,x,h-1);