# Top Level Namespace

## Constant Summary

FOURPI = `4.0 * Math::PI`
INV_FOURPI = `1.0 / FOURPI`
INV_PI = `1.0 / Math::PI`
INV_TWOPI = `1.0 / TWOPI`
PI_OVER_FOUR = `Math::PI / 4`
PI_OVER_TWO = `Math::PI / 2`
RADIANTS = `Math::PI / 180`
TWOPI = `2.0 * Math::PI`

TODO Use these constants everywhere

## Method Detail

def balance_heuristic(nf : Int32, f_pdf : Float64, ng : Int32, g_pdf : Float64) #

def clamp(x, min, max) #

def concentric_sample_disk(u1 : Float64 = rand, u2 : Float64 = rand) : ::Tuple(Float64, Float64) #

def cosine_hemisphere_pdf(cos_theta : Float64) #

def cosine_sample_hemisphere(u1 : Float64 = rand, u2 : Float64 = rand) : Vector #

def max(a, b) #

def min(a, b) #

def minmax(a, b) #

def mix(a, b, t) #

def power_heuristic(nf : Int32, f_pdf : Float64, ng : Int32, g_pdf : Float64) #

def random #

def same_hemisphere?(v1, v2) #

def sign(x : Float64) #

def smoothstep(x) #

def solve_quadratic(a, b, c) : ::Tuple(Float64, Float64)? #

def stratified_sample_1D(nx : Int32, jitter = true) #

TODO this is a litte bit different in pbrt

def stratified_sample_2D(nx : Int32, ny : Int32, jitter = true) #

TODO this is a litte bit different in pbrt

def uniform_hemisphere_pdf #

def uniform_sample_disk(u1 : Float64 = rand, u2 : Float64 = rand) : ::Tuple(Float64, Float64) #

def uniform_sample_hemisphere(u1 : Float64 = rand, u2 : Float64 = rand) #

def uniform_sample_sphere(u1 : Float64 = rand, u2 : Float64 = rand) #

def uniform_sphere_pdf #

## Macro Detail

macro assert(pred) #

macro assert(pred, message) #