Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * CA Winter 2014/15
- * Name, Vorname: Bargiel, Milan
- * Matrikelnummer: 11085631
- * Aufgabenblatt: 08
- * Aufgabe: 8.1
- */
- package aufgabenblatt_08.m11085631;
- import math.Vec3;
- import math.function.FunctionR1Vec3;
- public class WalkFunction extends FunctionR1Vec3 {
- private final float amplitude;
- private final float circFreq;
- private final float phase;
- private final float d;
- public WalkFunction(float phase) {
- super(Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY);
- this.amplitude = 20.0f; // Maximale Auslenkung
- this.d = 10.0f; // Verschiebung auf Y-Achse
- this.circFreq = (float)Math.PI; //Kreisfrequenz
- this.phase = phase; // Möglichkeit der Anpassung der Phase
- }
- @Override
- public Vec3 eval(float t) {
- return new Vec3 ((float) Math.toRadians(amplitude * Math.cos(circFreq * t + phase) + d), 0 , 0);
- }
- public String toString() {
- return "WalkFunction(x)";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement