8000 GitHub - vorg/hammersley: Computes i-th point in a Hammersley Point Set of size n
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

vorg/hammersley

Repository files navigation

hammersley

Computes i-th point in a Hammersley Point Set of size n.

Installation

npm install hammersley

Usage

import hammersley from "hammersley";

for (let i = 0; i < 300; i++) {
  const p = hammersley(i, 300);
  // 0 -> [0, 0]
  // 1 -> [0.00333, 0.5]
  // 2 -> [0.00666, 0.25]
  // 3 -> [0.01, 0.75]
  // ...
}

hammersley(i, n)

Parameters

  • i - index of sample which coordinates we want to calculate
  • n - number of samples in the point set we are generating

Returns

[x,y] - i-th point from a Hammersley point set of size n, x and y are from 0..1

See also

Based on Hammersley Points on the Hemisphere by Holger Dammertz [2012]

License

MIT, see LICENSE.md for details.

About

Computes i-th point in a Hammersley Point Set of size n

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0