From ce6fbe94f3df97e3256e9bef284fb6dc528d8b43 Mon Sep 17 00:00:00 2001 From: Laurent Le Goff Date: Wed, 29 Apr 2015 11:24:09 +0200 Subject: [PATCH] Remove old functions --- math.go | 27 --------------------------- transform.go | 8 ++++---- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/math.go b/math.go index 91b5482..8e15c14 100644 --- a/math.go +++ b/math.go @@ -3,36 +3,9 @@ package draw2d -func squareDistance(x1, y1, x2, y2 float64) float64 { - dx := x2 - x1 - dy := y2 - y1 - return dx*dx + dy*dy -} - -func min(x, y float64) float64 { - if x < y { - return x - } - return y -} - -func max(x, y float64) float64 { - if x > y { - return x - } - return y -} - func minMax(x, y float64) (min, max float64) { if x > y { return y, x } return x, y } - -func minUint32(a, b uint32) uint32 { - if a < b { - return a - } - return b -} diff --git a/transform.go b/transform.go index 00d177f..e3a8a86 100644 --- a/transform.go +++ b/transform.go @@ -49,10 +49,10 @@ func (tr MatrixTransform) TransformRectangle(x0, y0, x2, y2 *float64) { *y0, y1 = minMax(*y0, y1) *y2, y3 = minMax(*y2, y3) - *x0 = min(*x0, *x2) - *y0 = min(*y0, *y2) - *x2 = max(x1, x3) - *y2 = max(y1, y3) + *x0 = math.Min(*x0, *x2) + *y0 = math.Min(*y0, *y2) + *x2 = math.Max(x1, x3) + *y2 = math.Max(y1, y3) } func (tr MatrixTransform) TransformRasterPoint(points ...*raster.Point) {