Loading icosahedron/icosahedron.go +4 −4 Original line number Diff line number Diff line Loading @@ -22,11 +22,11 @@ const ( var ( // Phi is the "golden ratio" ( https://en.wikipedia.org/wiki/Golden_ratio ). Phi float64 Phi float32 ) func init() { Phi = 0.5 * (1.0 + math.Sqrt(5.0)) Phi = float32(0.5 * (1.0 + math.Sqrt(5.0))) } // Icosahedron holds the information for an icosahedron in one place. Loading Loading @@ -113,7 +113,7 @@ func (v Vertex) sub(a Vertex) Vertex { return r } func (v Vertex) scale(s float64) Vertex { func (v Vertex) scale(s float32) Vertex { var r Vertex r.x = v.x * s r.y = v.y * s Loading @@ -121,7 +121,7 @@ func (v Vertex) scale(s float64) Vertex { return r } func calculateMidPoint(va Vertex, vb Vertex, r float64) (Vertex, error) { func calculateMidPoint(va Vertex, vb Vertex, r float32) (Vertex, error) { vr := va.add(vb.sub(va).scale(r)) return vr, nil Loading icosahedron/structures.go +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ package icosahedron // Vertex is the tuple (x,y,z). type Vertex struct { x, y, z float64 x, y, z float32 } // Vertices of a regular icosahedron. Loading Loading
icosahedron/icosahedron.go +4 −4 Original line number Diff line number Diff line Loading @@ -22,11 +22,11 @@ const ( var ( // Phi is the "golden ratio" ( https://en.wikipedia.org/wiki/Golden_ratio ). Phi float64 Phi float32 ) func init() { Phi = 0.5 * (1.0 + math.Sqrt(5.0)) Phi = float32(0.5 * (1.0 + math.Sqrt(5.0))) } // Icosahedron holds the information for an icosahedron in one place. Loading Loading @@ -113,7 +113,7 @@ func (v Vertex) sub(a Vertex) Vertex { return r } func (v Vertex) scale(s float64) Vertex { func (v Vertex) scale(s float32) Vertex { var r Vertex r.x = v.x * s r.y = v.y * s Loading @@ -121,7 +121,7 @@ func (v Vertex) scale(s float64) Vertex { return r } func calculateMidPoint(va Vertex, vb Vertex, r float64) (Vertex, error) { func calculateMidPoint(va Vertex, vb Vertex, r float32) (Vertex, error) { vr := va.add(vb.sub(va).scale(r)) return vr, nil Loading
icosahedron/structures.go +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ package icosahedron // Vertex is the tuple (x,y,z). type Vertex struct { x, y, z float64 x, y, z float32 } // Vertices of a regular icosahedron. Loading