From e03455a979abf4444d4362dacbbf55c6915d3b69 Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 25 May 2021 11:40:23 +0200 Subject: Make Geometry Types iterable --- geometry.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'geometry.go') diff --git a/geometry.go b/geometry.go index 3c3ba83..04896dc 100644 --- a/geometry.go +++ b/geometry.go @@ -4,16 +4,12 @@ package main // representation of a three-dimensional point in space type Point struct { - x float32 - y float32 - z float32 + scalars [3]float32 // x = scalars[0], y = scalars[1], z = scalars[2] } // a triangle consists of three points type Triangle struct { - a *Point - b *Point - c *Point + points [3]*Point } // a surface is made of a slice of triangles -- cgit v1.2.3-70-g09d2