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


Java MathUtils.linearCombination方法代码示例

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


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

示例1: crossProduct

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/** Compute the cross-product of the instance with another vector.
 * @param v other vector
 * @return the cross product this ^ v as a new Vector3D
 */
public Vector3D crossProduct(final Vector<Euclidean3D> v) {
    final Vector3D v3 = (Vector3D) v;
    return new Vector3D(MathUtils.linearCombination(y, v3.z, -z, v3.y),
                        MathUtils.linearCombination(z, v3.x, -x, v3.z),
                        MathUtils.linearCombination(x, v3.y, -y, v3.x));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:Vector3D.java

示例2: Vector3D

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/** Linear constructor
 * Build a vector from three other ones and corresponding scale factors.
 * The vector built will be a1 * u1 + a2 * u2 + a3 * u3
 * @param a1 first scale factor
 * @param u1 first base (unscaled) vector
 * @param a2 second scale factor
 * @param u2 second base (unscaled) vector
 * @param a3 third scale factor
 * @param u3 third base (unscaled) vector
 */
public Vector3D(double a1, Vector3D u1, double a2, Vector3D u2,
                double a3, Vector3D u3) {
    this.x = MathUtils.linearCombination(a1, u1.x, a2, u2.x, a3, u3.x);
    this.y = MathUtils.linearCombination(a1, u1.y, a2, u2.y, a3, u3.y);
    this.z = MathUtils.linearCombination(a1, u1.z, a2, u2.z, a3, u3.z);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:17,代码来源:Vector3D.java

示例3: dotProduct

import org.apache.commons.math.util.MathUtils; //导入方法依赖的package包/类
/** {@inheritDoc}
 * <p>
 * The implementation uses specific multiplication and addition
 * algorithms to preserve accuracy and reduce cancellation effects.
 * It should be very accurate even for nearly orthogonal vectors.
 * </p>
 * @see MathUtils#linearCombination(double, double, double, double, double, double)
 */
public double dotProduct(final Vector<Euclidean3D> v) {
    final Vector3D v3 = (Vector3D) v;
    return MathUtils.linearCombination(x, v3.x, y, v3.y, z, v3.z);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:13,代码来源:Vector3D.java


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