Class CircleSector

    • Field Detail

      • r

        public final double r
      • theta1

        public final double theta1
      • theta2

        public final double theta2
      • n

        public final int n
    • Constructor Detail

      • CircleSector

        public CircleSector()
        Create half of a circle in the xy-plane with radius 1 and with 8 line segments around the circumference.
      • CircleSector

        public CircleSector​(double r)
        Create half of a circle in the xy-plane with radius r and with 8 line segments around the circumference.
        Parameters:
        r - radius of the circle
      • CircleSector

        public CircleSector​(double r,
                            double theta1,
                            double theta2,
                            int n)
        Create an arc (a sector) of a circle in the xy-plane with radius r, starting angle theta1, ending angle theta2, and with n line segments around the circumference.

        The arc is drawn counterclockwise starting at angle theta1 and ending at angle theta2. Notice that this means that if theta1 <= theta2, then we are drawing the arc between the angles, but if theta1 > theta2, then we are removing the arc between the angles.

        Notice that any two angles define two arcs from a circle. We want a definition for this method that unambiguously determines, for any two angles, which of the two arcs to draw.

        Parameters:
        r - radius of the circle
        theta1 - beginning angle of the sector (in radians)
        theta2 - ending angle of the sector (in radians)
        n - number of line segments in the circle's circumference
        Throws:
        IllegalArgumentException - if n is less than 3
    • Method Detail

      • remake

        public CircleSector remake​(int n,
                                   int k)
        Description copied from interface: MeshMaker
        Build an instance of the Model with new values for the number of lines of latitude and longitude while keeping all the other model parameters the same.
        Specified by:
        remake in interface MeshMaker
        Parameters:
        n - number of lines of latitude for the returned Model
        k - number of lines of longitude for the returned Model
        Returns:
        a new instance of the Model with the updated parameters