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


Java FastMath.tan方法代码示例

本文整理汇总了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;
		}
	}
}
 
开发者ID:rekit-group,项目名称:rekit-game,代码行数:25,代码来源:Mouth.java

示例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;
	}
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:29,代码来源:SphereFilter.java

示例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;
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:12,代码来源:TilesFilter.java

示例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);
    }
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:33,代码来源:PolarTilesFilter.java

示例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);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:12,代码来源:CauchyRandomProjectionFamily.java

示例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);
}
 
开发者ID:elki-project,项目名称:elki,代码行数:6,代码来源:CauchyDistribution.java

示例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));
}
 
开发者ID:elki-project,项目名称:elki,代码行数:16,代码来源:CauchyDistribution.java


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