aboutsummaryrefslogtreecommitdiff
path: root/geometry.go
diff options
context:
space:
mode:
Diffstat (limited to 'geometry.go')
-rw-r--r--geometry.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/geometry.go b/geometry.go
deleted file mode 100644
index ba3f643..0000000
--- a/geometry.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package main
-
-import (
- "image"
- "math"
-)
-
-type Point = image.Point
-type Rectangle = image.Rectangle
-
-func Distance(p1, p2 Point) float64 {
- return math.Sqrt(math.Pow(float64(p1.X-p2.X), 2) + math.Pow(float64(p1.Y-p2.Y), 2))
-}
-
-func Length(p Point) float64 {
- return Distance(p, Point{0, 0})
-}
-
-func Normalize(p Point) Point {
- return p.Div(int(Length(p)))
-}
-
-func AdjacentPoints(from Point) []Point {
- return []Point{
- from.Add(Point{X: 0, Y: -100}),
- from.Add(Point{X: 0, Y: 100}),
- from.Add(Point{X: -100, Y: 0}),
- from.Add(Point{X: 100, Y: 0}),
- }
-}