本文整理汇总了Java中net.jafama.FastMath.tan方法的典型用法代码示例。如果您正苦于以下问题:Java FastMath.tan方法的具体用法?Java FastMath.tan怎么用?Java FastMath.tan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.jafama.FastMath
的用法示例。
在下文中一共展示了FastMath.tan方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: logicLoop
import net.jafama.FastMath; //导入方法依赖的package包/类
public void logicLoop(float calcX, float deltaX) {
this.mouthCurvePos = this.parent.getPos().add(this.pos).addX(0.5f * this.size.x).addX(-calcX);
this.mouthCurveTimer.logicLoop();
float maxDelta = this.size.y * 0.5f * this.parent.getState().getMouthAmplitude();
while (this.mouthCurveTimer.timeUp()) {
this.mouthCurveTimer.reset();
Vec newVec = new Vec(calcX, (float) (FastMath.tan(calcX * 10) * FastMath.sinQuick(calcX * 4) * FastMath.cosQuick(calcX * 0.5f) * maxDelta));
if (newVec.y > maxDelta) {
newVec = newVec.setY(maxDelta);
}
if (newVec.y < -maxDelta) {
newVec = newVec.setY(-maxDelta);
}
this.mouthCurve.add(newVec);
}
Iterator<Vec> it = this.mouthCurve.iterator();
while (it.hasNext()) {
if (it.next().x <= calcX - this.size.x) {
it.remove();
} else {
break;
}
}
}
示例2: transformInverse
import net.jafama.FastMath; //导入方法依赖的package包/类
@Override
protected void transformInverse(int x, int y, float[] out) {
float dx = x - icentreX;
float dy = y - icentreY;
float x2 = dx * dx;
float y2 = dy * dy;
if (y2 >= (b2 - (b2 * x2) / a2)) {
out[0] = x;
out[1] = y;
} else {
float rRefraction = 1.0f / refractionIndex;
float z = (float) Math.sqrt((1.0f - x2 / a2 - y2 / b2) * (a * b));
float z2 = z * z;
float xAngle = (float) FastMath.acos(dx / Math.sqrt(x2 + z2));
float angle1 = ImageMath.HALF_PI - xAngle;
float angle2 = (float) FastMath.asin(FastMath.sin(angle1) * rRefraction);
angle2 = ImageMath.HALF_PI - xAngle - angle2;
out[0] = x - (float) FastMath.tan(angle2) * z;
float yAngle = (float) FastMath.acos(dy / Math.sqrt(y2 + z2));
angle1 = ImageMath.HALF_PI - yAngle;
angle2 = (float) FastMath.asin(FastMath.sin(angle1) * rRefraction);
angle2 = ImageMath.HALF_PI - yAngle - angle2;
out[1] = y - (float)FastMath.tan(angle2)*z;
}
}
示例3: transformInverse
import net.jafama.FastMath; //导入方法依赖的package包/类
@Override
protected void transformInverse(int x, int y, float[] out) {
float i = x - halfWidth;
float j = y - halfHeight;
float sampleX = (float) (i + (curvatureX * FastMath.tan(i * sizeX - shiftX/(double)sizeX)));
float sampleY = (float) (j + (curvatureY * FastMath.tan(j * sizeY - shiftY/(double)sizeY)));
out[0] = halfWidth + sampleX;
out[1] = halfHeight + sampleY;
}
示例4: transformInverse
import net.jafama.FastMath; //导入方法依赖的package包/类
@Override
protected void transformInverse(int x, int y, float[] out) {
float dx = x - cx;
float dy = y - cy;
double r = Math.sqrt(dx * dx + dy * dy);
double angle = FastMath.atan2(dy, dx);
float randomShift = 0;
if (randomness > 0) {
// randomShift = randomness * Noise.noise2((float) angle, (float) (2.0f * r / srcWidth));
randomShift = randomness * Noise.noise2(dx / srcWidth, dy / srcHeight);
}
if (numADivisions > 0) {
double angleShift = FastMath.tan(randomShift + t + angle * numADivisions / 2) * curvature * (numADivisions / 4.0) / r;
angle += angleShift;
}
if (numRDivisions > 0) {
double rShift = FastMath.tan(3 * randomShift + r / srcWidth * 2 * Math.PI * numRDivisions) * numRDivisions * curvature / 2;
r += rShift;
}
angle += rotateResult;
double zoomedR = r / zoom;
float u = (float) (zoomedR * FastMath.cos(angle));
float v = (float) (zoomedR * FastMath.sin(angle));
out[0] = (u + cx);
out[1] = (v + cy);
}
示例5: generateProjection
import net.jafama.FastMath; //导入方法依赖的package包/类
@Override
public Projection generateProjection(int idim, int odim) {
double[][] matrix = new double[odim][idim];
for(int i = 0; i < odim; ++i) {
double[] row = matrix[i];
for(int j = 0; j < idim; ++j) {
row[j] = FastMath.tan(Math.PI * (random.nextDouble() - .5));
}
}
return new MatrixProjection(matrix);
}
示例6: nextRandom
import net.jafama.FastMath; //导入方法依赖的package包/类
@Override
public double nextRandom() {
final double r = random.nextDouble() - .5;
return location + shape / FastMath.tan(Math.PI * r);
}
示例7: quantile
import net.jafama.FastMath; //导入方法依赖的package包/类
/**
* PDF function, static version.
*
* @param x Value
* @param location Location (x0)
* @param shape Shape (gamma)
* @return PDF value
*/
public static double quantile(double x, double location, double shape) {
return (x <= .5) ? (x == .5) ? location //
: (x == 0.) ? Double.NEGATIVE_INFINITY //
: location - shape / FastMath.tan(Math.PI * x) //
: (x == 1.) ? Double.POSITIVE_INFINITY //
: location + shape / FastMath.tan(Math.PI * (1 - x));
}