本文整理汇总了Java中com.flowpowered.math.TrigMath.TWO_PI属性的典型用法代码示例。如果您正苦于以下问题:Java TrigMath.TWO_PI属性的具体用法?Java TrigMath.TWO_PI怎么用?Java TrigMath.TWO_PI使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.flowpowered.math.TrigMath
的用法示例。
在下文中一共展示了TrigMath.TWO_PI属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: spiral
@Override
public void spiral(double radius, double points, double fullrot,
double rotation,
Consumer<Vector3d> cb) {
double a = radius / points;
double s = fullrot / points;
double arad = s * TrigMath.TWO_PI;
rotation *= TrigMath.TWO_PI; //torad
for (double i = 1; i <= points; i++) {
double dist = i * a;
double angle = i * arad + rotation;
double x = TrigMath.cos(angle) * dist;
double y = TrigMath.sin(angle) * dist;
cb.accept(new Vector3d(x, 0, y));
}
}
示例2: circle
@Override
public void circle(Location location, int count, double radius, Consumer<Location> callback) {
Extent e = location.getExtent();
double increment = TrigMath.TWO_PI / count;
for (int i = 0; i < count; i++) {
double angle = i * increment;
double x = location.getX() + radius * TrigMath.cos(angle);
double z = location.getZ() + radius * TrigMath.sin(angle);
callback.accept(new Location(e, x, location.getY(), z));
}
}
示例3: ellipse
@Override
public void ellipse(Vector3d[] vector3ds, double a, double b, double vecmult, Vector3d rotationAngle) {
double increment = TrigMath.TWO_PI / vector3ds.length;
for (int i = 0; i < vector3ds.length; i++) {
double angle = i * increment;
Vector3d v = new Vector3d(a * TrigMath.cos(angle), b * TrigMath.sin(angle), 0).mul(vecmult);
vector3ds[i] = VectorUtils.rotateAroundAxisY(v, -rotationAngle.getY());
}
}
示例4: fillCircle
public void fillCircle(Vector3d[] d, double radius) {
double increment = TrigMath.TWO_PI / d.length;
for (int i = 0; i < d.length; i++) {
double angle = i * increment;
double x = radius * TrigMath.cos(angle);
double z = radius * TrigMath.sin(angle);
d[i] = new Vector3d(x, 0, z);
}
}