Remove old functions

This commit is contained in:
Laurent Le Goff 2015-04-29 11:24:09 +02:00
parent 79f25c1ea2
commit ce6fbe94f3
2 changed files with 4 additions and 31 deletions

27
math.go
View file

@ -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
}

View file

@ -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) {