Why Nostr? What is Njump?
2023-07-20 09:37:17
in reply to

Ana Tudor 🐯 on Nostr: Also #tinyCodingTip: random uniform sphere surface distribution with polar ...

Also #tinyCodingTip: random uniform sphere surface distribution with polar coordinates!

u = rand(0, 1)
v = rand(0, 1)

❌ DON'T (pole clusters)
θ = 2·π·u
φ = v·π - π/2

✅ DO
θ = 2·π·u
φ = acos(2·v - 1) - π/2

➞x,y,z
x = r·cos(φ)·sin(θ)
y = r·sin(φ)
z = r·cos(φ)·cos(θ)

Pure CSS illustration of concept 😼
https://codepen.io/thebabydino/pen/yLzxdjj

#CSS #CodePen #3D #maths #geometry #mathematics #coding #frontend #webDev #webDevelopment #distribution



Author Public Key
npub1wzrcns4nynt3aegu8qvxyffxu8k6rahtmx5ll6ap7z24f036y43q0u2nuu