package class4_1_RobotFactories;// Dr. Yoder. MSOE. 19 December 2016 /** * This robot has a central arm that rotates around the robot base. * It then has a telescoping hand that moves in and out from the * center. */ public class CircularRobot extends AbstractRobot { private CircularRobot() { } private double length; private double angle; @Override public void setTarget(double x, double y) { super.setTarget(x, y); angle = Math.atan2(y,x); length = Math.hypot(x,y); } @Override public String toString() { return "The robot reaches the target at "+getTargetString()+ " by setting the " + "arm to angle "+angle+" radians and telescoping to "+length+" meters."; } public static class CircularRobotFactory implements RobotFactory { @Override public AbstractRobot create() { return new CircularRobot(); } } }