【发布时间】:2013-06-26 21:44:57
【问题描述】:
有谁知道我如何在 Robocode 中的某个点周围按照斐波那契模式进行螺旋运动?我有 setTurnRight (double)、setAhead (double)、getX () 和 getY () 等方法。
我试着用这种方式制作一个没有所需标准的简单螺旋,但它不起作用......它更像是一个圆圈。
this.setAhead(this.direction * Double.POSITIVE_INFINITY);
if (this.direction == 1) {
this.setTurnRight(Utils.normalRelativeAngleDegrees(this.enemy.getBearing() + 60));
} else {
this.setTurnRight(Utils.normalRelativeAngleDegrees(this.enemy.getBearing() + 120));
}
【问题讨论】:
-
要绘制螺旋线,您必须逐渐增加半径。 maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/…
-
但是加多少?多久一次?
-
阅读我链接的帖子。
-
我认为
x = sin(t)、y = cos(t)和z = t会形成螺旋。
标签: java fibonacci spiral robocode