Class Square


  • public class Square
    extends Model
    Create a wireframe model of a square in the xy-plane centered at the origin.

    Here is a picture showing how the square's four vertices are labeled.

    
                       y
                       |
                       |
          v1           |            v2
            +----------------------+
            |          |           |
            |          |           |
            |          |           |
            |          |           |
      ------|----------+-----------|-------> x
            |          |           |
            |          |           |
            |          |           |
            +----------------------+
          v0           |            v3
                       |
                       |
    
    • Constructor Detail

      • Square

        public Square()
        Create a square in the xy-plane with corners (±1, ±1, 0).
      • Square

        public Square​(double r)
        Create a square in the xy-plane with corners (±r, ±r, 0).
        Parameters:
        r - determines the corners of the square
        Throws:
        IllegalArgumentException - if r is less than or equal to 0