/** * Converts the specified user x-coordinate to device x-coordinate. * @param xu the user x-coordinate. * @return the device x-coordinate. */ public int x(double xu) { if(_xpScale==AxisScale.LOG10) xu = log10(xu); double xd = _xushift+_xuscale*xu; if (xd<DMIN) { xd = DMIN; } else if (xd>DMAX) { xd = DMAX; } return (int)(xd); }
/** * Converts the specified user y-coordinate to device y-coordinate. * @param yu the user y-coordinate. * @return the device y-coordinate. */ public int y(double yu) { if(_ypScale==AxisScale.LOG10) yu = log10(yu); double yd = _yushift+_yuscale*yu; if (yd<DMIN) { yd = DMIN; } else if (yd>DMAX) { yd = DMAX; } return (int)(yd); }
/** * Constructs axis tics for a specified maximum number of major tics. * @param x1 the value at one end of the axis. * @param x2 the value at the other end of the axis. */ public LogAxisTics(double x1, double x2) { super(x1,x2,0); double xmin = min(x1,x2); double xmax = max(x1,x2); _expMin = log10(xmin); _expMax = log10(xmax); _dtic = 1; _ftic = pow(10,ceil(_expMin)); _ntic = (int)(floor(ArrayMath.log10(xmax))-ceil(ArrayMath.log10(xmin)))+1; computeMultiple(); computeMinorTics(); }
private KaiserWindow(double error, double width, double length) { _error = error; _width = width; _length = length; double a = -20.0*log10(_error); if (a<=21.0) { _alpha = 0.0; } else if (a<=50.0) { _alpha = 0.5842*pow(a-21.0,0.4)+0.07886*(a-21.0); } else { _alpha = 0.1102*(a-8.7); } _scale = 1.0/ino(_alpha); _xxmax = 0.25*_length*_length; }
/** * Returns a new transcaler that combines this transcaler with projectors. * The returned transcaler includes the transforms of the projectors. * Does not change this transcaler. * @param xp the projector for x coordinates. * @param yp the projector for y coordinates. * @return the new transcaler. */ public Transcaler combineWith(Projector xp, Projector yp) { AxisScale xsc = xp.getScale(); AxisScale ysc = yp.getScale(); double x1v = (xsc==AxisScale.LOG10)?log10(xp.v(_x1u)):xp.v(_x1u); double x2v = (xsc==AxisScale.LOG10)?log10(xp.v(_x2u)):xp.v(_x2u); double y1v = (ysc==AxisScale.LOG10)?log10(yp.v(_y1u)):yp.v(_y1u); double y2v = (ysc==AxisScale.LOG10)?log10(yp.v(_y2u)):yp.v(_y2u); return new Transcaler(x1v,y1v,x2v,y2v,_x1d,_y1d,_x2d,_y2d, xsc, ysc); }
/** * Returns a Kaiser window with specified error and transition width. * @param error the maximum absolute error. * @param width the transition width. * @return the window. */ public static KaiserWindow fromErrorAndWidth(double error, double width) { Check.argument(error>0.0,"error>0.0"); Check.argument(error<1.0,"error<1.0"); Check.argument(width>0.0,"width>0.0"); double a = -20.0*log10(error); double d = (a>21.0)?(a-7.95)/14.36:0.9222; double length = d/width; return new KaiserWindow(error,width,length); }
/** * Returns a Kaiser window with specified error and window length. * @param error the maximum absolute error. * @param length the two-sided window length. * @return the window. */ public static KaiserWindow fromErrorAndLength(double error, double length) { Check.argument(error>0.0,"error>0.0"); Check.argument(error<1.0,"error<1.0"); Check.argument(length>0,"length>0"); double a = -20.0*log10(error); double d = (a>21.0)?(a-7.95)/14.36:0.9222; double width = d/length; return new KaiserWindow(error,width,length); }
for (int imult=0; imult<nmult; ++imult) { int m = _mult[imult]; int l = (int)floor(log10(dmax/m)); double d = m*pow(10.0,l); double f = ceil(xmin/d)*d;