Class TriangleSampler.TriangleSamplerND

    • Field Detail

      • a

        private final double[] a
        The first vertex.
      • b

        private final double[] b
        The second vertex.
      • c

        private final double[] c
        The third vertex.
    • Constructor Detail

      • TriangleSamplerND

        TriangleSamplerND​(UniformRandomProvider rng,
                          double[] a,
                          double[] b,
                          double[] c)
        Parameters:
        rng - Source of randomness.
        a - The first vertex.
        b - The second vertex.
        c - The third vertex.
    • Method Detail

      • createSample

        public double[] createSample​(double p1msmt,
                                     double s,
                                     double t)
        Description copied from class: TriangleSampler
        Creates the sample given the random variates s and t in the interval [0, 1] and s + t <= 1. The sum 1 - s - t is provided. The sample can be obtained from the triangle abc using:
         p = a(1 - s - t) + sb + tc
         
        Specified by:
        createSample in class TriangleSampler
        Parameters:
        p1msmt - plus 1 minus s minus t (1 - s - t)
        s - the first variate s
        t - the second variate t
        Returns:
        the sample