本文整理汇总了Java中net.jafama.FastMath.hypot方法的典型用法代码示例。如果您正苦于以下问题:Java FastMath.hypot方法的具体用法?Java FastMath.hypot怎么用?Java FastMath.hypot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.jafama.FastMath
的用法示例。
在下文中一共展示了FastMath.hypot方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deflate
import net.jafama.FastMath; //导入方法依赖的package包/类
private void deflate(double[] e, int p, int k, boolean wantv) {
double f = e[p - 2];
e[p - 2] = 0.0;
for(int j = p - 2; j >= k; j--) {
double t = FastMath.hypot(s[j], f);
double cs = s[j] / t;
double sn = f / t;
s[j] = t;
if(j != k) {
f = -sn * e[j - 1];
e[j - 1] = cs * e[j - 1];
}
if(wantv) {
for(int i = 0; i < n; i++) {
t = cs * V[i][j] + sn * V[i][p - 1];
V[i][p - 1] = -sn * V[i][j] + cs * V[i][p - 1];
V[i][j] = t;
}
}
}
}
示例2: split
import net.jafama.FastMath; //导入方法依赖的package包/类
private void split(double[] e, int p, int k, boolean wantu) {
double f = e[k - 1];
e[k - 1] = 0.0;
for(int j = k; j < p; j++) {
double t = FastMath.hypot(s[j], f);
double cs = s[j] / t;
double sn = f / t;
s[j] = t;
f = -sn * e[j];
e[j] = cs * e[j];
if(wantu) {
for(int i = 0; i < m; i++) {
t = cs * U[i][j] + sn * U[i][k - 1];
U[i][k - 1] = -sn * U[i][j] + cs * U[i][k - 1];
U[i][j] = t;
}
}
}
}
示例3: tql2ComputeImplicitShift
import net.jafama.FastMath; //导入方法依赖的package包/类
private double tql2ComputeImplicitShift(int l) {
final double g = d[l];
final double p = (d[l + 1] - g) / (2.0 * e[l]);
double r = FastMath.hypot(p, 1.0);
r = (p >= 0) ? r : -r;
d[l] = e[l] / (p + r);
d[l + 1] = e[l] * (p + r);
double h = g - d[l];
for(int i = l + 2; i < n; i++) {
d[i] -= h;
}
return h;
}
示例4: tql2ImplicitQL
import net.jafama.FastMath; //导入方法依赖的package包/类
private void tql2ImplicitQL(int l, int m, double dl1) {
double p = d[m];
double c = 1.0, c2 = 1.0, c3 = 1.0;
final double el1 = e[l + 1];
double s = 0.0, s2 = 0.0;
for(int i = m - 1; i >= l; i--) {
c3 = c2;
c2 = c;
s2 = s;
double g = c * e[i];
double h = c * p;
double r = FastMath.hypot(p, e[i]);
e[i + 1] = s * r;
s = e[i] / r;
c = p / r;
p = c * d[i] - s * g;
d[i + 1] = h + s * (c * g + s * d[i]);
// Accumulate transformation.
for(int k = 0; k < n; k++) {
final double[] Vk = V[k];
h = Vk[i + 1];
Vk[i + 1] = s * Vk[i] + c * h;
Vk[i] = c * Vk[i] - s * h;
}
}
p = -s * s2 * c3 * el1 * e[l] / dl1;
e[l] = s * p;
d[l] = c * p;
}
示例5: hypot
import net.jafama.FastMath; //导入方法依赖的package包/类
private float hypot(float x, float y) {
return (float) FastMath.hypot(x, y);
}