RightTriangle.java


Below is the syntax highlighted version of RightTriangle.java from §1.5 Input and Output.


/******************************************************************************
 *  Compilation:  javac-introcs RightTriangle.java
 *  Execution:    java-introcs RightTriangle
 *
 *  Draws a right triangle and a circumscribing circle.
 *
 ******************************************************************************/

public class RightTriangle {

    public static void main(String[] args) {
        StdDraw.square(0.5, 0.5, 0.5);
        StdDraw.setPenColor(StdDraw.BLUE);
        StdDraw.line(0.5, 0.5, 0.9, 0.5);
        StdDraw.line(0.9, 0.5, 0.5, 0.8);
        StdDraw.line(0.5, 0.8, 0.5, 0.5);
        StdDraw.circle(0.7, 0.65, 0.25);
    }
}


Copyright © 2000–2022, Robert Sedgewick and Kevin Wayne.
Last updated: Thu Aug 11 10:14:17 EDT 2022.