Class TriangularPrism

    • Constructor Summary

      Constructors 
      Constructor Description
      TriangularPrism()
      Create a right equilateral triangular prism with a regular tetrahedrons attached to each end so that the total length runs from -1 to 1 along the y-axis.
      TriangularPrism​(double s, double h)
      Create an equilateral triangular prism that runs from -h to h along the y-axis, has triangle side length s, and has a regular tetrahedron attached to each end.
      TriangularPrism​(double r, double h, double theta, int n)
      Create an equilateral triangular prism that runs from -h to h along the y-axis, with the triangle inscribed in a circle of radius r, has a tetrahedron attached to each end where the face-edge-face angle of each tetrahedron is theta (with theta in radians!), and has n lines of latitude around the body of the prism.
      TriangularPrism​(double r, double h, double h2, int n, boolean bothHalves)
      Create an equilateral triangular prism that runs from -h to h along the y-axis, with the triangle inscribed in a circle of radius r, has a tetrahedron attached to each end where the height of each tetrahedron is h2, and has n lines of latitude around the body of the prism.
      TriangularPrism​(double s, double h, int n)
      Create an equilateral triangular prism that runs from -h to h along the y-axis, has triangle side length s, has a regular tetrahedron attached to each end, and has n lines of latitude around the body of the prism.
    • Constructor Detail

      • TriangularPrism

        public TriangularPrism()
        Create a right equilateral triangular prism with a regular tetrahedrons attached to each end so that the total length runs from -1 to 1 along the y-axis.
      • TriangularPrism

        public TriangularPrism​(double s,
                               double h)
        Create an equilateral triangular prism that runs from -h to h along the y-axis, has triangle side length s, and has a regular tetrahedron attached to each end.
        Parameters:
        s - the length of the triangle's sides
        h - the body of the prism runs from -h to h along the y-axis
      • TriangularPrism

        public TriangularPrism​(double s,
                               double h,
                               int n)
        Create an equilateral triangular prism that runs from -h to h along the y-axis, has triangle side length s, has a regular tetrahedron attached to each end, and has n lines of latitude around the body of the prism.
        Parameters:
        s - the length of the triangle's sides
        h - the body of the prism runs from -h to h along the y-axis
        n - number of lines of latitude around the body of the prism
        Throws:
        IllegalArgumentException - if n is less than 0
      • TriangularPrism

        public TriangularPrism​(double r,
                               double h,
                               double theta,
                               int n)
        Create an equilateral triangular prism that runs from -h to h along the y-axis, with the triangle inscribed in a circle of radius r, has a tetrahedron attached to each end where the face-edge-face angle of each tetrahedron is theta (with theta in radians!), and has n lines of latitude around the body of the prism.

        If theta = 0, then there are no tetrahedrons at the ends of the prism.

        If theta = arctan(sqrt(2)) = 54.736°, then the tetrahedrons are regular.

        Parameters:
        r - radius of circle in xz-plane that the equilateral triangle is inscribed in
        h - the body of the prism runs from -h to h along the y-axis
        theta - slant angle of each tetrahedron at the ends of the prism
        n - number of lines of latitude around the body of the prism
        Throws:
        IllegalArgumentException - if n is less than 0
      • TriangularPrism

        public TriangularPrism​(double r,
                               double h,
                               double h2,
                               int n,
                               boolean bothHalves)
        Create an equilateral triangular prism that runs from -h to h along the y-axis, with the triangle inscribed in a circle of radius r, has a tetrahedron attached to each end where the height of each tetrahedron is h2, and has n lines of latitude around the body of the prism.

        So the total height is 2*(h + h2).

        Parameters:
        r - radius of circle in xz-plane that the equilateral triangle is inscribed in
        h - the body of the prism runs from h to -h in the y-direction
        h2 - height of each tetrahedron at the ends of the prism
        n - number of lines of latitude around the body of the prism
        bothHalves - determines if both halves or only the top half gets created
        Throws:
        IllegalArgumentException - if n is less than 0