当前位置: 首页>>代码示例>>Java>>正文


Java FastMath.atan方法代码示例

本文整理汇总了Java中org.apache.commons.math3.util.FastMath.atan方法的典型用法代码示例。如果您正苦于以下问题:Java FastMath.atan方法的具体用法?Java FastMath.atan怎么用?Java FastMath.atan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.math3.util.FastMath的用法示例。


在下文中一共展示了FastMath.atan方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIncidence

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/**
 * Calculate the incidence angle
 */
public double getIncidence(int position) {
	double incidenceangle = 0.0;
	try{

     // estimation of incidence angle based on near and range distance values
     double nearincidence = FastMath.toRadians(getIncidenceNear().doubleValue());
     double sataltitude=getSatelliteAltitude();

     double distancerange = sataltitude * FastMath.tan(nearincidence) + position * this.getPixelsize()[0];
     incidenceangle = FastMath.atan(distancerange / sataltitude);
	}catch(Exception e){
		logger.warn("Error calculatiing incidence angle:"+e.getMessage());
	}
    return incidenceangle;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:19,代码来源:SarImageReader.java

示例2: cumulativeProbability

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double cumulativeProbability(double x) {
    return 0.5 + (FastMath.atan((x - median) / scale) / FastMath.PI);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:5,代码来源:CauchyDistribution.java

示例3: value

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc} */
public double value(double x) {
    return FastMath.atan(x);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:5,代码来源:Atan.java

示例4: atan

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** {@inheritDoc} */
public SparseGradient atan() {
    return new SparseGradient(FastMath.atan(value), 1.0 / (1 + value * value), derivatives);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:5,代码来源:SparseGradient.java

示例5: atan

import org.apache.commons.math3.util.FastMath; //导入方法依赖的package包/类
/** Compute arc tangent of a derivative structure.
 * @param operand array holding the operand
 * @param operandOffset offset of the operand in its array
 * @param result array where result must be stored (for
 * arc tangent the result array <em>cannot</em> be the input
 * array)
 * @param resultOffset offset of the result in its array
 */
public void atan(final double[] operand, final int operandOffset,
                 final double[] result, final int resultOffset) {

    // create the function value and derivatives
    double[] function = new double[1 + order];
    final double x = operand[operandOffset];
    function[0] = FastMath.atan(x);
    if (order > 0) {
        // the nth order derivative of atan has the form:
        // dn(atan(x)/dxn = Q_n(x) / (1 + x^2)^n
        // where Q_n(x) is a degree n-1 polynomial with same parity as n-1
        // Q_1(x) = 1, Q_2(x) = -2x, Q_3(x) = 6x^2 - 2 ...
        // the general recurrence relation for Q_n is:
        // Q_n(x) = (1+x^2) Q_(n-1)'(x) - 2(n-1) x Q_(n-1)(x)
        // as per polynomial parity, we can store coefficients of both Q_(n-1) and Q_n in the same array
        final double[] q = new double[order];
        q[0] = 1;
        final double x2    = x * x;
        final double f     = 1.0 / (1 + x2);
        double coeff = f;
        function[1] = coeff * q[0];
        for (int n = 2; n <= order; ++n) {

            // update and evaluate polynomial Q_n(x)
            double v = 0;
            q[n - 1] = -n * q[n - 2];
            for (int k = n - 1; k >= 0; k -= 2) {
                v = v * x2 + q[k];
                if (k > 2) {
                    q[k - 2] = (k - 1) * q[k - 1] + (k - 1 - 2 * n) * q[k - 3];
                } else if (k == 2) {
                    q[0] = q[1];
                }
            }
            if ((n & 0x1) == 0) {
                v *= x;
            }

            coeff *= f;
            function[n] = coeff * v;

        }
    }

    // apply function composition
    compose(operand, operandOffset, function, result, resultOffset);

}
 
开发者ID:biocompibens,项目名称:SME,代码行数:57,代码来源:DSCompiler.java


注:本文中的org.apache.commons.math3.util.FastMath.atan方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。