MCPcopy Create free account
hub / github.com/pyscript/pyscript / curl2

Function curl2

core/tests/manual/issue-2302/perlin_py.py:100–110  ·  view source on GitHub ↗
(x, y, z)

Source from the content-addressed store, hash-verified

98 )
99
100def curl2(x, y, z):
101 # https://www.bit-101.com/2017/2021/07/curl-noise/
102 delta = 0.01
103 n1 = perlin3(x + delta, y, z)
104 n2 = perlin3(x - delta, y, z)
105 cy = -(n1 - n2) / (delta * 2)
106 n1 = perlin3(x, y + delta, z)
107 n2 = perlin3(x, y - delta, z)
108 cx = -(n1 - n2) / (delta * 2)
109 print(n1, n2)
110 return V3(cx, cy, 0)

Callers

nothing calls this directly

Calls 2

perlin3Function · 0.85
V3Class · 0.85

Tested by

no test coverage detected