diff --git a/src/Worm.java b/src/Worm.java index f35a646..fdf540b 100644 --- a/src/Worm.java +++ b/src/Worm.java @@ -94,7 +94,13 @@ public class Worm { return this.orientation; } + + /** + * @param orientation + * + */ public void setOrientation(double orientation) { + this.orientation = orientation; } @@ -149,7 +155,12 @@ public class Worm { } /** +<<<<<<< HEAD * @param NumberSteps +======= + * + * @param NumberSteps ... +>>>>>>> e58c4a26566e73a84d38d7f871aa21b85f295ea8 * * @post the new x-coordinate schould be the old one plus the number of steps multiplied * with the distance of a step in the x-orientation @@ -165,6 +176,7 @@ public class Worm { public void move(int numberSteps) { if (numberSteps < 0) throw new IllegalArgumentException(); +<<<<<<< HEAD double distanceX = getRadius() * Math.cos(getOrientation()); double distanceY = getRadius() * Math.sin(getOrientation()); setCoordX(getCoordX() + numberSteps * distanceX); @@ -186,5 +198,11 @@ public class Worm { public void turn(double angleToAdd) { assert 0 <= angleToAdd && angleToAdd < 2 * Math.PI; +======= + double distanceX = this.radius * Math.cos(this.orientation); + double distanceY = this.radius * Math.sin(this.orientation); + setCoordX(this.coordX + NumberSteps * distanceX); + setCoordY(this.coordY + NumberSteps * distanceY); +>>>>>>> e58c4a26566e73a84d38d7f871aa21b85f295ea8 } }