Class CylinderSector

    • Field Detail

      • r

        public final double r
      • h

        public final double h
      • theta1

        public final double theta1
      • theta2

        public final double theta2
      • n

        public final int n
      • k

        public final int k
    • Constructor Detail

      • CylinderSector

        public CylinderSector()
        Create half of a cylinder with radius 1 and its axis along the y-axis from y = 1 to y = -1.
      • CylinderSector

        public CylinderSector​(double r,
                              double h,
                              double theta1,
                              double theta2,
                              int n,
                              int k)
        Create a part of the cylinder with radius r and its axis along the y-axis from y = h to y = -h.

        The partial cylinder is a cylinder over the circular sector from angle theta1 to angle theta2 (in the counterclockwise direction).

        The last two parameters determine the number of lines of longitude and the number of (partial) circles of latitude in the model.

        If there are n circles of latitude in the model, then each line of longitude will have n-1 line segments. If there are k lines of longitude, then each (partial) circle of latitude will have k-1 line segments.

        There must be at least four lines of longitude and at least two circles of latitude.

        Parameters:
        r - radius of the cylinder
        h - height of the cylinder (from h to -h along the y-axis)
        theta1 - beginning longitude angle of the sector (in radians)
        theta2 - ending longitude angle of the sector (in radians)
        n - number of circles of latitude around the cylinder
        k - number of lines of longitude
        Throws:
        IllegalArgumentException - if n is less than 2
        IllegalArgumentException - if k is less than 4
    • Method Detail

      • remake

        public CylinderSector 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