f32/d2/rect.go
func (r Rectangle) Canon() Rectangle {
	if r.Max[0] < r.Min[0] {
		r.Min[0], r.Max[0] = r.Max[0], r.Min[0]
	}
	if r.Max[1] < r.Min[1] {
		r.Min[1], r.Max[1] = r.Max[1], r.Min[1]
	}
	return r
}
func (r Rectangle) Canon() Rectangle {
	if r.Max[0] < r.Min[0] {
		r.Min[0], r.Max[0] = r.Max[0], r.Min[0]
	}
	if r.Max[1] < r.Min[1] {
		r.Min[1], r.Max[1] = r.Max[1], r.Min[1]
	}
	return r
}
func ( r Rectangle ) Canon ( ) Rectangle { if r . Max [ 0 ] < r . Min [ 0 ] { r . Min [ 0 ] , r . Max [ 0 ] = r . Max [ 0 ] , r . Min [ 0 ] } if r . Max [ 1 ] < r . Min [ 1 ] { r . Min [ 1 ] , r . Max [ 1 ] = r . Max [ 1 ] , r . Min [ 1 ] } return r }
// Canon returns the canonical version of r. The returned rectangle has minimum
// and maximum coordinates swapped if necessary so that it is well-formed.
Canon returns the canonical version of r . The returned rectangle has minimum and maximum coordinates swapped if necessary so that it is well - formed .