jmath

package
v0.0.0-...-e2d5c53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Epsilon = 1e-12

Variables

View Source
var Identity = Transform{
	Matrix: [4]float32{1, 0, 0, 1},
}

Functions

func Abs32

func Abs32(f float32) float32

func AbsInt32

func AbsInt32(x int32) int32

func Acos32

func Acos32(x float32) float32

func AlignUp

func AlignUp[Int constraints.Integer](len Int, alignment Int) Int

func Asin32

func Asin32(x float32) float32

func Atan232

func Atan232(y, x float32) float32

func Cbrt32

func Cbrt32(x float32) float32

func Ceil32

func Ceil32(f float32) float32

func Clamp

func Clamp[T constraints.Integer | constraints.Float](x, minv, maxv T) T

func Copysign32

func Copysign32(f, sign float32) float32

func Cos32

func Cos32(x float32) float32

func Float16frombits

func Float16frombits(val Float16) float32

Float16frombits converts a 16-bit precision IEEE-754 binary16 float to float32.

This implementation was adapted from Fabian Giesen's `half_to_float()` function which can be found at <https://gist.github.com/rygorous/2156668#file-gistfile1-cpp-L574>

func Floor32

func Floor32(f float32) float32

func Hypot32

func Hypot32(a, b float32) float32

func PointToF32

func PointToF32(p curve.Point) [2]float32

func Pow32

func Pow32(x, y float32) float32

func Round32

func Round32(f float32) float32

func Sin32

func Sin32(x float32) float32

func Sincos32

func Sincos32(x float32) (float32, float32)

func Sqrt32

func Sqrt32(f float32) float32

Types

type Float16

type Float16 = uint16

func Float16bits

func Float16bits(val float32) Float16

Float16bits converts a float32 to IEEE-754 binary16 format represented as the bits of a u16. This implementation was adapted from Fabian Giesen's `float_to_half_fast3`() function which can be found at <https://gist.github.com/rygorous/2156668#file-gistfile1-cpp-L285>

type Transform

type Transform struct {
	Matrix      [4]float32
	Translation [2]float32
	// contains filtered or unexported fields
}

func TransformFromKurbo

func TransformFromKurbo(transform curve.Affine) Transform

func (Transform) Mul

func (t Transform) Mul(other Transform) Transform

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL