class Boat implements MovingObject{ private double x, y, angle; public void setAngle(double value){angle=value;} public void move(double meters){ //if(Math.abs(angle)<0.001){x+=meters;} //if(Math.abs(angle-90)<0.001){y+=meters;} x+=meters*Math.cos(Math.toRadians(angle)); y+=meters*Math.sin(Math.toRadians(angle)); } public double getX(){return x;} public double getY(){return y;} public void setX(double value){x=value;} public void setY(double value){y=value;} }