README
A halton sequence implementation in js.
Classes
- haltonSequence
A 2D halton sequence generator.
- vanDerCorput
A Van der Corput sequence generator.
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. |
Object
haltonSequence.getNext() ⇒ 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. |
Number
vanDerCorput.compute(i, b) ⇒ 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. |
Number
vanDerCorput.getNext() ⇒ Get the next element from the sequence.
Kind: instance method of vanDerCorput
Returns: Number
- The next element.