gradCoord3D method

double gradCoord3D(
  1. int seed,
  2. int x,
  3. int y,
  4. int z,
  5. double xd,
  6. double yd,
  7. double zd,
)

Implementation

double gradCoord3D(
    int seed, int x, int y, int z, double xd, double yd, double zd) {
  int hash = seed;
  hash ^= X_PRIME * x;
  hash ^= Y_PRIME * y;
  hash ^= Z_PRIME * z;
  hash = hash * hash * hash * 60493;
  hash = (hash >> 13) ^ hash;
  D3 g = GRAD_3D[(hash & 15)];
  return xd * g.x + yd * g.y + zd * g.z;
}