public void update() { rad += increment; if (rad > (Math.PI * 2)) { rad = 0.0; } coords[0] = 0.8 * Math.cos(rad); coords[1] = 0.8 * Math.sin(rad); }
/* translate from 0 to 1, to a half circle * 0.0 = 0 * 0.5 = 1 * 1.0 = 0 */ private float halfCircle(float t) { return (float) Math.sin(t * 3.1415927f); }
Sweep() { rad = 0; increment = 0.01; coords = new double[] {0.8 * Math.cos(rad), 0.8 * Math.sin(rad), 0.0}; origin = new double[] {0.0, 0.0, 0.0}; }