gpt4 book ai didi

org.geotools.resources.XMath.log10()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 03:59:05 27 4
gpt4 key购买 nike

本文整理了Java中org.geotools.resources.XMath.log10()方法的一些代码示例,展示了XMath.log10()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMath.log10()方法的具体详情如下:
包路径:org.geotools.resources.XMath
类名称:XMath
方法名:log10

XMath.log10介绍

[英]Computes the logarithm in base 10. See http://developer.java.sun.com/developer/bugParade/bugs/4074599.html.
[中]计算以10为底的对数。看见http://developer.java.sun.com/developer/bugParade/bugs/4074599.html.

代码示例

代码示例来源:origin: org.geotools/gt2-widgets-swing

/**
 * Initialise l'itrateur.
 *
 * @param minimum           Valeur minimale de la premire graduation.
 * @param maximum           Valeur limite des graduations. La dernire
 *                          graduation n'aura pas ncessairement cette valeur.
 * @param visualLength      Longueur visuelle de l'axe sur laquelle tracer la graduation.
 *                          Cette longueur doit tre exprime en pixels ou en points.
 * @param visualTickSpacing Espace  laisser visuellement entre deux marques de graduation.
 *                          Cet espace doit tre exprim en pixels ou en points (1/72 de pouce).
 */
protected void init(final double minimum,
          final double maximum,
          final float  visualLength,
          final float  visualTickSpacing)
{
  final double logMin = XMath.log10(minimum);
  final double logMax = XMath.log10(maximum);
  super.init(logMin, logMax, visualLength, visualTickSpacing);
  scale  = (maximum-minimum) / (logMax-logMin);
  offset = minimum - scale*logMin;
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Formats the specified number.
 */
private String format(final Number value) {
  if (numberFormat == null) {
    numberFormat = NumberFormat.getNumberInstance(locale);
    numberFormat.setMinimumFractionDigits(0);
  }
  int precision = 0;
  if (!XMath.isInteger(value.getClass())) {
    precision = PRECISION;
    final double v = Math.abs(value.doubleValue());
    if (v > 0) {
      final int digits = (int) XMath.log10(v);
      if (Math.abs(digits) >= PRECISION) {
        // TODO: Switch to exponential notation when a convenient API will be available in J2SE.
        return value.toString();
      }
      if (digits >= 0) {
        precision -= digits;
      }
      precision = Math.max(0, PRECISION - precision);
    }
  }
  numberFormat.setMaximumFractionDigits(precision);
  return numberFormat.format(value);
}

代码示例来源:origin: org.geotools/gt2-coverage

/**
 * Computes the smallest number of fraction digits necessary to resolve all
 * quantitative values. This method assume that geophysics values in the range
 * {@code Category.geophysics(true).getRange} are stored as integer sample
 * values in the range {@code Category.geophysics(false).getRange}.
 */
private static int getFractionDigitCount(final Category[] categories) {
  int ndigits = 0;
  final double EPS = 1E-6;
  final int length=categories.length;
  for (int i=0; i<length; i++) {
    final Category geophysics = categories[i].geophysics(true);
    final Category samples    = categories[i].geophysics(false);
    final double ln = XMath.log10((geophysics.maximum - geophysics.minimum)/
                   (   samples.maximum -    samples.minimum));
    if (!Double.isNaN(ln)) {
      final int n = -(int)(Math.floor(ln + EPS));
      if (n>ndigits) {
        ndigits = Math.min(n, MAX_DIGITS);
      }
    }
  }
  return ndigits;
}

代码示例来源:origin: org.geotools/gt2-coverageio

int width  = Math.max((int) Math.floor(XMath.log10(maximum)) + 1,
           format.getMinimumIntegerDigits());
int digits = Math.min(format.getMaximumFractionDigits(), MAXIMUM_DIGITS);

代码示例来源:origin: org.geotools/gt2-widgets-swing

final double factor = XMath.pow10((int)Math.floor(XMath.log10(increment)));
increment /= factor;
if (Double.isNaN(increment) || Double.isInfinite(increment) || increment==0) {

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com