diff --git a/xmath/geom/insets.go b/xmath/geom/insets.go index bd9a9c3..34773c1 100644 --- a/xmath/geom/insets.go +++ b/xmath/geom/insets.go @@ -15,6 +15,12 @@ import ( "github.com/richardwilkes/toolbox/xmath" ) +// Insets32 is an alias for the float32 version of Insets. +type Insets32 = Insets[float32] + +// Insets64 is an alias for the float64 version of Insets. +type Insets64 = Insets[float64] + // Insets defines margins on each side of a rectangle. type Insets[T xmath.Numeric] struct { Top T `json:"top"` diff --git a/xmath/geom/matrix2d.go b/xmath/geom/matrix2d.go index cfd650a..ee04b26 100644 --- a/xmath/geom/matrix2d.go +++ b/xmath/geom/matrix2d.go @@ -14,6 +14,12 @@ import ( "golang.org/x/exp/constraints" ) +// Matrix2D32 is an alias for the float32 version of Matrix2D. +type Matrix2D32 = Matrix2D[float32] + +// Matrix2D64 is an alias for the float64 version of Matrix2D. +type Matrix2D64 = Matrix2D[float64] + // Matrix2D provides a 2D matrix. type Matrix2D[T constraints.Float] struct { ScaleX T diff --git a/xmath/geom/point.go b/xmath/geom/point.go index ad15df7..a8e1f99 100644 --- a/xmath/geom/point.go +++ b/xmath/geom/point.go @@ -17,6 +17,12 @@ import ( "github.com/richardwilkes/toolbox/xmath" ) +// Pt32 is an alias for the float32 version of Point. +type Pt32 = Point[float32] + +// Pt64 is an alias for the float64 version of Point. +type Pt64 = Point[float64] + // Point defines a location. type Point[T xmath.Numeric] struct { X T `json:"x"` diff --git a/xmath/geom/poly/contour.go b/xmath/geom/poly/contour.go index 61b2f36..175c641 100644 --- a/xmath/geom/poly/contour.go +++ b/xmath/geom/poly/contour.go @@ -15,6 +15,12 @@ import ( "golang.org/x/exp/constraints" ) +// Contour32 is an alias for the float32 version of Contour. +type Contour32 = Contour[float32] + +// Contour64 is an alias for the float64 version of Contour. +type Contour64 = Contour[float64] + // Contour is a sequence of vertices connected by line segments, forming a closed shape. type Contour[T constraints.Float] []geom.Point[T] diff --git a/xmath/geom/poly/polygon.go b/xmath/geom/poly/polygon.go index 4dfb2e5..6b7a4e6 100644 --- a/xmath/geom/poly/polygon.go +++ b/xmath/geom/poly/polygon.go @@ -14,6 +14,12 @@ import ( "golang.org/x/exp/constraints" ) +// Polygon32 is an alias for the float32 version of Polygon. +type Polygon32 = Polygon[float32] + +// Polygon64 is an alias for the float64 version of Polygon. +type Polygon64 = Polygon[float64] + // Polygon holds one or more contour lines. The polygon may contain holes and may be self-intersecting. type Polygon[T constraints.Float] []Contour[T] diff --git a/xmath/geom/rect.go b/xmath/geom/rect.go index 8f2ae3a..095bbb3 100644 --- a/xmath/geom/rect.go +++ b/xmath/geom/rect.go @@ -18,6 +18,12 @@ import ( "github.com/richardwilkes/toolbox/xmath" ) +// Rect32 is an alias for the float32 version of Rect. +type Rect32 = Rect[float32] + +// Rect64 is an alias for the float64 version of Rect. +type Rect64 = Rect[float64] + // Rect defines a rectangle. type Rect[T xmath.Numeric] struct { Point[T] `json:",inline"` diff --git a/xmath/geom/size.go b/xmath/geom/size.go index d96c72a..62f25f1 100644 --- a/xmath/geom/size.go +++ b/xmath/geom/size.go @@ -17,6 +17,12 @@ import ( "github.com/richardwilkes/toolbox/xmath" ) +// Size32 is an alias for the float32 version of Size. +type Size32 = Size[float32] + +// Size64 is an alias for the float64 version of Size. +type Size64 = Size[float64] + // Size defines a width and height. type Size[T xmath.Numeric] struct { Width T `json:"w"`