blob: 3c3ba83665ca568822192cbf5d081d6f18db3182 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// vim: shiftwidth=4 tabstop=4 noexpandtab
package main
// representation of a three-dimensional point in space
type Point struct {
x float32
y float32
z float32
}
// a triangle consists of three points
type Triangle struct {
a *Point
b *Point
c *Point
}
// a surface is made of a slice of triangles
type Surface struct {
triangles []*Triangle
}
|