Class TriangleSampler.TriangleSampler3D

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double ax
      The x component of vertex a.
      private double ay
      The y component of vertex a.
      private double az
      The z component of vertex a.
      private double bx
      The x component of vertex b.
      private double by
      The y component of vertex b.
      private double bz
      The z component of vertex b.
      private double cx
      The x component of vertex c.
      private double cy
      The y component of vertex c.
      private double cz
      The z component of vertex c.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double[] createSample​(double p1msmt, double s, double t)
      Creates the sample given the random variates s and t in the interval [0, 1] and s + t <= 1.
      TriangleSampler withUniformRandomProvider​(UniformRandomProvider rng)
      Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ax

        private final double ax
        The x component of vertex a.
      • ay

        private final double ay
        The y component of vertex a.
      • az

        private final double az
        The z component of vertex a.
      • bx

        private final double bx
        The x component of vertex b.
      • by

        private final double by
        The y component of vertex b.
      • bz

        private final double bz
        The z component of vertex b.
      • cx

        private final double cx
        The x component of vertex c.
      • cy

        private final double cy
        The y component of vertex c.
      • cz

        private final double cz
        The z component of vertex c.
    • Constructor Detail

      • TriangleSampler3D

        TriangleSampler3D​(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