package uebung10.logo;

public class Turtle {
    private double x;
    private double y;
    private double angle;

    public Turtle(double x, double y, double angle) {
        this.x = x;
        this.y = y;
        this.angle = angle;
    }

    public double getX() {
        return x;
    }

    public double getY() {
        return y;
    }

    public double getAngle() {
        return angle;
    }

    public void turn(double degrees) {
        angle += degrees;
    }

    public void go(double dist) {
        final double rad = Math.toRadians(angle);
        x += dist * Math.cos(rad);
        y -= dist * Math.sin(rad);
    }
}
