MCPcopy Create free account
hub / github.com/PerroEngine/Perro / rand_in_circle

Function rand_in_circle

perro_source/api_modules/perro_modules/src/random.rs:307–311  ·  view source on GitHub ↗
(seed: u32)

Source from the content-addressed store, hash-verified

305}
306
307#[inline]
308pub fn rand_in_circle(seed: u32) -> (f32, f32) {
309 let angle = rand01(seed) * std::f32::consts::TAU;
310 let radius = rand01(seed.wrapping_add(STREAM_GAMMA)).sqrt();
311 (radius * angle.cos(), radius * angle.sin())
312}
313
314#[inline]

Calls 2

rand01Function · 0.85
sinMethod · 0.80