MCPcopy Create free account
hub / github.com/carbonengine/trinity / TriFloatRandomGauss

Function TriFloatRandomGauss

trinity/TriMath.cpp:228–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228float TriFloatRandomGauss( float mu, float deviation )
229{
230 // box-muller
231 float rand1 = TriFloatRandom01();
232 if( rand1 < 1e-100 )
233 {
234 rand1 = 1e-100;
235 }
236 rand1 = -2.f * log( rand1 );
237 float rand2 = TriFloatRandom01() * TRI_2PI;
238 return mu + deviation * pow( rand1, 0.75f ) * cos( rand2 );
239}
240
241/////////////////////////////////////////////////////////////////////////////////////////
242// Color extensions

Callers 1

RebuildMethod · 0.85

Calls 1

TriFloatRandom01Function · 0.85

Tested by

no test coverage detected