Documentation ¶
Index ¶
- func Abs[...](n T) T
- func BitwiseAnd[...](a, b T) T
- func BitwiseLeftShift[...](a T, shift ST) T
- func BitwiseNot[...](a T) T
- func BitwiseOr[...](a, b T) T
- func BitwiseRightShift[...](a T, shift ST) T
- func BitwiseXor[...](a, b T) T
- func Clamp[T constraints.Ordered](x, min, max T) T
- func Floor[F AnyFloat](x F) F
- func Fmod[T ~float32 | ~float64](x, y T) T
- func GetRandomNumber[...]() T
- func IsInf[F AnyFloat](f F, sign int) bool
- func IsNaN[T ~float32 | ~float64](n T) bool
- func Max[T constraints.Ordered](items ...T) T
- func Min[T constraints.Ordered](items ...T) T
- func Mod[...](x T, y T) T
- func Modf[F AnyFloat](f F) (int F, frac F)
- func NaN[T ~float32 | ~float64]() T
- func Product[...](values ...T) T
- func Sum[...](values ...T) T
- type AnyFloat
- type Vector2
- func (vec *Vector2[T]) Add(other Vector2[T])
- func (vec *Vector2[T]) AddWithinBounds(bounds Vector2[T], update Vector2[T])
- func (vec *Vector2[T]) AddWithinBoundsAndForceAbsolute(bounds Vector2[T], update Vector2[T])
- func (vec Vector2[T]) ContainsNaN() bool
- func (vec *Vector2[T]) Divide(other Vector2[T])
- func (vec *Vector2[T]) Equal(other Vector2[T]) bool
- func (vec *Vector2[T]) EqualWithinTolerance(other Vector2[T], tolerance Vector2[T]) bool
- func (vec *Vector2[T]) FromString(v string)
- func (vec *Vector2[T]) Multiply(other Vector2[T])
- func (vec Vector2[T]) String() string
- func (vec *Vector2[T]) Substract(other Vector2[T])
- func (vec Vector2[T]) ToString() string
- func (vec Vector2[T]) ToTuple() (x, y T)
- type Vector3
- func (vec *Vector3[T]) Add(other Vector3[T])
- func (vec *Vector3[T]) AddWithinBounds(bounds Vector3[T], update Vector3[T])
- func (vec *Vector3[T]) AddWithinBoundsAndForceAbsolute(bounds Vector3[T], update Vector3[T])
- func (vec Vector3[T]) ContainsNaN() bool
- func (vec *Vector3[T]) Divide(other Vector3[T])
- func (vec *Vector3[T]) Equal(other Vector3[T]) bool
- func (vec *Vector3[T]) EqualWithinTolerance(other Vector3[T], tolerance Vector3[T]) bool
- func (vec *Vector3[T]) FromString(v string)
- func (vec *Vector3[T]) Multiply(other Vector3[T])
- func (vec Vector3[T]) String() string
- func (vec *Vector3[T]) Substract(other Vector3[T])
- func (vec Vector3[T]) ToString() string
- func (vec Vector3[T]) ToTuple() (x, y, z T)
- type Vector4
- func (vec *Vector4[T]) Add(other Vector4[T])
- func (vec *Vector4[T]) AddWithinBounds(bounds Vector4[T], update Vector4[T])
- func (vec *Vector4[T]) AddWithinBoundsAndForceAbsolute(bounds Vector4[T], update Vector4[T])
- func (vec Vector4[T]) ContainsNaN() bool
- func (vec *Vector4[T]) Divide(other Vector4[T])
- func (vec *Vector4[T]) Equal(other Vector4[T]) bool
- func (vec *Vector4[T]) EqualWithinTolerance(other Vector4[T], tolerance Vector4[T]) bool
- func (vec *Vector4[T]) FromString(v string)
- func (vec *Vector4[T]) Multiply(other Vector4[T])
- func (vec Vector4[T]) String() string
- func (vec *Vector4[T]) Substract(other Vector4[T])
- func (vec Vector4[T]) ToString() string
- func (vec Vector4[T]) ToTuple() (x, y, z, w T)
- type VectorUnderlyingType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BitwiseAnd ¶
func BitwiseAnd[T ~int8 | ~int16 | ~int32 | ~int64 | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~uint](a, b T) T
Bitwise and
func BitwiseLeftShift ¶
func BitwiseLeftShift[T ~int8 | ~int16 | ~int32 | ~int64 | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~uint, ST int | uint](a T, shift ST) T
Bitwise Left Shift
func BitwiseNot ¶
func BitwiseNot[T ~int8 | ~int16 | ~int32 | ~int64 | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~uint](a T) T
Bitwise not
func BitwiseOr ¶
func BitwiseOr[T ~int8 | ~int16 | ~int32 | ~int64 | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~uint](a, b T) T
Bitwise or
func BitwiseRightShift ¶
func BitwiseRightShift[T ~int8 | ~int16 | ~int32 | ~int64 | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~uint, ST int | uint](a T, shift ST) T
Bitwise Right Shift
func BitwiseXor ¶
func BitwiseXor[T ~int8 | ~int16 | ~int32 | ~int64 | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~uint](a, b T) T
Bitwise xor
func Clamp ¶
func Clamp[T constraints.Ordered](x, min, max T) T
Clamp clamps number within the inclusive lower and upper bounds.
func GetRandomNumber ¶
func Max ¶
func Max[T constraints.Ordered](items ...T) T
func Min ¶
func Min[T constraints.Ordered](items ...T) T
Types ¶
type Vector2 ¶
type Vector2[T VectorUnderlyingType] struct { X T Y T }
Vector2D
func SameVector2 ¶
func SameVector2[T VectorUnderlyingType](number T) Vector2[T]
Make Same Vector2D where all values of the vector are the same number specified
func (*Vector2[T]) AddWithinBounds ¶
AddWithinBounds Add update vector to current one within bounds of bounds vector
func (*Vector2[T]) AddWithinBoundsAndForceAbsolute ¶
AddWithinBoundsAndForceAbsolute Add update vector to current one within bounds of bounds vector and force value of vector to be positive
func (Vector2[T]) ContainsNaN ¶
ContainsNaN checks if vector contains NaN
func (*Vector2[T]) EqualWithinTolerance ¶
EqualWithinTolerance check if current vector is within tolerance vector of other vector
func (*Vector2[T]) FromString ¶
Change values of current vector to values from string representation
type Vector3 ¶
type Vector3[T VectorUnderlyingType] struct { X T Y T Z T }
Vector3D
func SameVector3 ¶
func SameVector3[T VectorUnderlyingType](number T) Vector3[T]
Make Same Vector3D where all values of the vector are the same number specified
func (*Vector3[T]) AddWithinBounds ¶
AddWithinBounds Add update vector to current one within bounds of bounds vector
func (*Vector3[T]) AddWithinBoundsAndForceAbsolute ¶
AddWithinBoundsAndForceAbsolute Add update vector to current one within bounds of bounds vector and force value of vector to be positive
func (Vector3[T]) ContainsNaN ¶
ContainsNaN checks if vector contains NaN
func (*Vector3[T]) EqualWithinTolerance ¶
EqualWithinTolerance check if current vector is within tolerance vector of other vector
func (*Vector3[T]) FromString ¶
Change values of current vector to values from string representation
type Vector4 ¶
type Vector4[T VectorUnderlyingType] struct { X T Y T Z T W T }
Vector4D
func SameVector4 ¶
func SameVector4[T VectorUnderlyingType](number T) Vector4[T]
Make Same Vector4D where all values of the vector are the same number specified
func (*Vector4[T]) AddWithinBounds ¶
AddWithinBounds Add update vector to current one within bounds of bounds vector
func (*Vector4[T]) AddWithinBoundsAndForceAbsolute ¶
AddWithinBoundsAndForceAbsolute Add update vector to current one within bounds of bounds vector and force value of vector to be positive
func (Vector4[T]) ContainsNaN ¶
ContainsNaN checks if vector contains NaN
func (*Vector4[T]) EqualWithinTolerance ¶
EqualWithinTolerance check if current vector is within tolerance vector of other vector
func (*Vector4[T]) FromString ¶
Change values of current vector to values from string representation