func UniformSphere(u0, u1 float64) m.Vec3 {
	theta := 2 * u0 * math.Pi
	z := -1.0 + 2*u1
	r := math.Sqrt(1 - z*z)
	x := r * math.Cos(theta)
	y := r * math.Sin(theta)
	return m.Vec3{float32(x), float32(y), float32(z)}
}
UniformSphere returns a unit vector uniformly sampled from the sphere.
pdf is 1/(4*Pi)
package sample
import (
	m "github.com/jamiec7919/vermeer/math"
	"math"
)
func CosineHemisphere(u0, u1 float64) m.Vec3 {
	r := math.Sqrt(1 - u0)
	theta := 2 * math.Pi * u1
	x := r * math.Cos(theta)
	y := r * math.Sin(theta)
	return m.Vec3{float32(x), float32(y), float32(math.Sqrt(u0))}
}
func CosineHemisphere2(u0, u1 float64) m.Vec3 {
	r := math.Sqrt(u0)
	theta := 2 * math.Pi * u1
	x := r * math.Cos(theta)
	y := r * math.Sin(theta)
	return m.Vec3{float32(x), float32(y), float32(math.Sqrt(1 - u0))}
}
func CosineHemisphereConcentric(u0, u1 float64) m.Vec3 {
	var r, phi float64
	u0 = -1 + (u0 * 2)
	u1 = -1 + (u1 * 2)
	switch {
	case u0 > -u1 && u0 > u1:
		r = u0
		phi = (math.Pi / 4) * (u1 / u0)
	case u0 < u1 && u0 > -u1:
		r = u1
		phi = (math.Pi / 4) * (2 - u0/u1)
	case u0 < -u1 && u0 < u1:
		r = -u0
		phi = (math.Pi / 4) * (4 + u1/u0)
	case u0 > u1 && u0 < -u1:
		r = -u1
		phi = (math.Pi / 4) * (6 - u0/u1)
	}
	x := r * math.Cos(phi)
	y := r * math.Sin(phi)
	return m.Vec3{float32(x), float32(y), m.Sqrt(1 - float32(r*r))}
}
func UniformHemisphere(u0, u1 float64) m.Vec3 {
	r := math.Sqrt(1 - u1*u1)
	theta := 2 * math.Pi * u0
	x := r * math.Cos(theta)
	y := r * math.Sin(theta)
	return m.Vec3{float32(x), float32(y), float32(u1)}
}