Class PyramidFrustum

    • Constructor Summary

      Constructors 
      Constructor Description
      PyramidFrustum()
      Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of 2, top side length of 1, and height 1/2.
      PyramidFrustum​(double s1, double s2, double h)
      Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of s1, top side length of s2, and height h.
      PyramidFrustum​(double s1, double s2, double h, int n, int k)
      Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of s1, top side length of s2, and height h.
      PyramidFrustum​(int n, int k, double s, double h, double a)
      Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of s, top of the frustum at height h, and with the pyramid's apex at on the y-axis at height a.
    • Field Detail

      • s1

        public final double s1
      • s2

        public final double s2
      • h

        public final double h
      • n

        public final int n
      • k

        public final int k
    • Constructor Detail

      • PyramidFrustum

        public PyramidFrustum()
        Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of 2, top side length of 1, and height 1/2.
      • PyramidFrustum

        public PyramidFrustum​(double s1,
                              double s2,
                              double h)
        Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of s1, top side length of s2, and height h.

        This model works with either s1 > s2 or s1 < s2. In other words, the frustum can have its "apex" either above or below the xz-plane.

        Parameters:
        s1 - side length of the base of the frustum
        s2 - side length of the top of the frustum
        h - height of the frustum
      • PyramidFrustum

        public PyramidFrustum​(int n,
                              int k,
                              double s,
                              double h,
                              double a)
        Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of s, top of the frustum at height h, and with the pyramid's apex at on the y-axis at height a.
        Parameters:
        n - number of lines of latitude
        k - number of lines of longitude
        s - side length of the base of the frustum
        h - height of the frustum
        a - height of the apex of the pyramid
        Throws:
        IllegalArgumentException - if n is less than 0
        IllegalArgumentException - if k is less than 1
      • PyramidFrustum

        public PyramidFrustum​(double s1,
                              double s2,
                              double h,
                              int n,
                              int k)
        Create a frustum of a right square pyramid with its base in the xz-plane, a base side length of s1, top side length of s2, and height h.

        This model works with either s1 > s2 or s1 < s2. In other words, the frustum can have its "apex" either above or below the xz-plane.

        Parameters:
        s1 - side length of the base of the frustum
        s2 - side length of the top of the frustum
        h - height of the frustum
        n - number of lines of latitude
        k - number of lines of longitude
        Throws:
        IllegalArgumentException - if n is less than 0
        IllegalArgumentException - if k is less than 1
    • Method Detail

      • remake

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