[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-dev
Subject: [jira] [Created] (RNG-133) LineSampler: Sample uniformly within a line
From: "Alex Herbert (Jira)" <jira () apache ! org>
Date: 2021-04-29 12:40:00
Message-ID: JIRA.13375837.1619699970000.373088.1619700000685 () Atlassian ! JIRA
[Download RAW message or body]
Alex Herbert created RNG-133:
--------------------------------
Summary: LineSampler: Sample uniformly within a line
Key: RNG-133
URL: https://issues.apache.org/jira/browse/RNG-133
Project: Commons RNG
Issue Type: New Feature
Components: sampling
Affects Versions: 1.4
Reporter: Alex Herbert
Create a sampler to sample uniformly within a line:
{code:java}
public abstract class LineSampler implements
SharedStateSampler<LineSampler> {
public static LineSampler of(double[] a,
double[] b,
UniformRandomProvider rng);
}
{code}
Sampling can be performed using the same method as the TriangleSampler without the third coordinate:
{noformat}
v = b - a
p = a + s * v
with s a uniform deviate in [0, 1]
{noformat}
To allow computation with any finite coordinates the vector does not require computation:
{noformat}
p = a + s * (b - a)
= a + sb - sa
= (1 - s)a + sb
{noformat}
This is the same method used in the {{ContinuousUniformSampler}} but extended to N-dimensions.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic