Esempio n. 1
0
File: cones.go Progetto: fogleman/ln
func (t *Tree) Paths() ln.Paths {
	paths := t.Shape.Paths()
	for i := 0; i < 128; i++ {
		p := math.Pow(rand.Float64(), 1.5)*0.5 + 0.5
		c := t.V0.Add(t.V1.Sub(t.V0).MulScalar(p))
		a := rand.Float64() * 2 * math.Pi
		l := (1 - p) * 8
		d := ln.Vector{math.Cos(a), math.Sin(a), -2.75}.Normalize()
		e := c.Add(d.MulScalar(l))
		paths = append(paths, ln.Path{c, e})
	}
	return paths
}