Class TetrahedronSampler

    • Method Detail

      • sample

        public double[] sample()
        Description copied from interface: ObjectSampler
        Create a sample.
        Specified by:
        sample in interface ObjectSampler<double[]>
        Returns:
        a random Cartesian point within the tetrahedron.
      • of

        public static TetrahedronSampler of​(UniformRandomProvider rng,
                                            double[] a,
                                            double[] b,
                                            double[] c,
                                            double[] d)
        Create a tetrahedron sampler with vertices a, b, c and d. Sampled points are uniformly distributed within the tetrahedron.

        No test for a volume is performed. If the vertices are coplanar the sampling distribution is undefined.

        Parameters:
        rng - Source of randomness.
        a - The first vertex.
        b - The second vertex.
        c - The third vertex.
        d - The fourth vertex.
        Returns:
        the sampler
        Throws:
        IllegalArgumentException - If the vertices do not have length 3; or vertices have non-finite coordinates