Class BarycentricTriangle

    • Field Detail

      • theta

        public final double theta
      • n

        public final int n
    • Constructor Detail

      • BarycentricTriangle

        public BarycentricTriangle​(int n)
        Create a barycentricly subdivided equilateral triangle in the xy-plane with corners on the unit circle.

        The value of n should be less than 8.

        Parameters:
        n - number of barycentric subdivisions of the triangle
        Throws:
        IllegalArgumentException - if n is less than 0
      • BarycentricTriangle

        public BarycentricTriangle​(double theta,
                                   int n)
        Create a barycentricly subdivided equilateral triangle in the xy-plane with corners on the unit circle and rotated by angle theta degrees.

        The value of n should be less than 8.

        Parameters:
        theta - rotation (in degrees) of the equilateral triangle
        n - number of barycentric subdivisions of this triangle
        Throws:
        IllegalArgumentException - if n is less than 0
    • Method Detail

      • barycentric

        public void barycentric​(int vIndex0,
                                int vIndex1,
                                int vIndex2,
                                int n)
        Recursively use barycentric subdivision to put into this Model vertices and line segments that subdivide the triangle whose vertices are indexed by vIndex0, vIndex1 and vIndex2.

        The value of n should be less than 8.

        Parameters:
        vIndex0 - index of a {link Vertex} of a triangle
        vIndex1 - index of a {link Vertex} of a triangle
        vIndex2 - index of a {link Vertex} of a triangle
        n - number of barycentric subdivisions of this triangle
      • remake

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