low-discrepancy-sequence
v0.2.1
Published
A halton sequence implementation in js.
Downloads
8
Readme
A halton sequence implementation in js.
Classes
haltonSequence
A 2D halton sequence generator.
Kind: global class
new haltonSequence([bases], [seed])
Constructor
| Param | Type | Default | Description | | --- | --- | --- | --- | | [bases] | Array | [2,3] | A Vector representing the bases of the sequence. | | [seed] | Number | 1 | The seed to start the sequence index with. |
haltonSequence.getNext() ⇒ Object
Get the next 2d element from the halton sequence.
Kind: instance method of haltonSequence
Returns: Object - The element in form {x,y}.
vanDerCorput
A Van der Corput sequence generator.
Kind: global class
- vanDerCorput
- new vanDerCorput([base], [index])
- .compute(i, b) ⇒ Number
- .getNext() ⇒ Number
new vanDerCorput([base], [index])
Constructor
| Param | Type | Default | Description | | --- | --- | --- | --- | | [base] | Number | 2 | The base. | | [index] | Number | 1 | The index to start the sequence with. |
vanDerCorput.compute(i, b) ⇒ Number
Compute the given result at an index and base.
Kind: instance method of vanDerCorput
Returns: Number - The computed value of the element at the index and base.
| Param | Type | Description | | --- | --- | --- | | i | Number | The index. | | b | Number | The base. |
vanDerCorput.getNext() ⇒ Number
Get the next element from the sequence.
Kind: instance method of vanDerCorput
Returns: Number - The next element.