Discover Packages
github.com/google/agi
core
math
f32
package
Version:
v3.2.0+incompatible
Opens a new window with list of versions in this module.
Published: Sep 30, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: ? modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package f32 is a basic math library for float32.
Abs returns the absolute of v.
MaxOf returns the maximum value of all the arguments.
MinOf returns the minimum value of all the arguments.
Round rounds v to the nearest integer.
Examples:
Round(-0.9) = -1
Round(-0.1) = 0
Round(0.0) = 0
Round(0.1) = 0
Round(0.9) = 1
Sqrt returns the square root of v.
V3D is a three element vector of float32.
The elements are in the order X, Y, Z.
Add3D returns the element-wise addition of vector a and b.
Cross3D returns the cross product of vector a and b.
Sub3D returns the element-wise subtraction of vector b from a.
Magnitude returns the magnitude of the vector.
Normalize returns the normalized vector of v.
Scale returns the element-wise scaling of v with s.
SqrMagnitude returns the magnitude of the vector.
W returns a V4D with the first three elements set to v and the fourth set
to w.
V4D is a four element vector of float32.
The elements are in the order X, Y, Z, W.
Add4D returns the element-wise addition of vector a and b.
Sub4D returns the element-wise subtraction of vector b from a.
Magnitude returns the magnitude of the vector.
Normalize returns the normalized vector of v.
Scale returns the element-wise scaling of v with s.
SqrMagnitude returns the magnitude of the vector.
XYZ returns a V3D formed from first three elements of v.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.