/****************************************************************************** * Compilation: javac BlueCone.java * Execution: java BlueCone * * Draws a blue cone of radius 0.5 and height 1 at the location * (0, 0, 0) on an orange background. * * Keywords: Cone, Background ******************************************************************************/ public class BlueCone { public static void main(String[] args) { // Sets the scale of the drawing window StdDraw3D.setScale(-1, 1); // Sets the background color to orange StdDraw3D.clear(StdDraw3D.ORANGE); // Defines the dimensions of the cone double radius = 0.5; double height = 1; // Draws a blue cone StdDraw3D.setPenColor(StdDraw3D.BLUE); StdDraw3D.cone(0, 0, 0, radius, height); // Renders the 3D scene StdDraw3D.finished(); } }