MCPcopy
hub / github.com/fogleman/ln / Paths2

Method Paths2

ln/sphere.go:107–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105}
106
107func (s *Sphere) Paths2() Paths {
108 var equator Path
109 for lng := 0; lng <= 360; lng++ {
110 v := LatLngToXYZ(0, float64(lng), s.Radius)
111 equator = append(equator, v)
112 }
113 var paths Paths
114 for i := 0; i < 100; i++ {
115 m := Identity()
116 for j := 0; j < 3; j++ {
117 v := RandomUnitVector()
118 m = m.Rotate(v, rand.Float64()*2*math.Pi)
119 }
120 m = m.Translate(s.Center)
121 paths = append(paths, equator.Transform(m))
122 }
123 return paths
124}
125
126func (s *Sphere) Paths() Paths {
127 var paths Paths

Callers

nothing calls this directly

Calls 6

TransformMethod · 0.95
LatLngToXYZFunction · 0.85
IdentityFunction · 0.85
RandomUnitVectorFunction · 0.85
RotateMethod · 0.80
TranslateMethod · 0.80

Tested by

no test coverage detected