public class Line { public static void main(String[] args) { // Input l and theta double l = Double.parseDouble(args[0]); int theta = Integer.parseInt(args[1]); double cx = 0.5, cy = 0.5; StdDraw.enableDoubleBuffering(); while (true) { double x = cx + l * Math.cos(Math.toRadians(theta)); double y = cy + l * Math.sin(Math.toRadians(theta)); StdDraw.clear(); StdDraw.line(cx, cy, x, y); StdDraw.show(); StdDraw.pause(1); theta = (theta + 2) % 360; } } // main() } // class Line