# vec3 library Null safety

## Constants

dist → const double Function( a, b)
`distance`
div → const List<double> Function( out, a, b)
`divide`
len → const double Function( a)
`length`
mul → const List<double> Function( out, a, b)
`multiply`
sqrDist → const double Function( a, b)
`squaredDistance`
sqrLen → const double Function( a)
`squaredLength`
sub → const List<double> Function( out, a, b)
`subtract`

## Properties

forEach List<double> Function( a, int? stride, int? offset, int? count, dynamic fn, dynamic arg)
Perform some operation over an array of vec3s.
final

## Functions

angle( a, b)
Get the angle between two 3D vectors @param {ReadonlyVec3} a The first operand @param {ReadonlyVec3} b The second operand @returns {Number} The angle in radians
bezier(dynamic out, dynamic a, dynamic b, dynamic c, dynamic d, dynamic t) List<double>
Performs a bezier interpolation with two control points
ceil( out, a) List<double>
math.ceil the components of a vec3
clone(dynamic a) List<double>
Creates a new vec3 initialized with values from an existing vector
copy( out, dynamic a) List<double>
Copy the values from one vec3 to another
create() List<double>
Creates a new, empty vec3
cross( out, a, b) List<double>
Computes the cross product of two vec3's
distance( a, b)
Calculates the euclidian distance between two vec3's
divide( out, a, b) List<double>
Divides two vec3's
dot( a, b)
Calculates the dot product of two vec3's
equals(dynamic a, dynamic b) bool
Returns whether or not the vectors have approximately the same elements in the same position.
exactEquals(dynamic a, dynamic b) bool
Returns whether or not the vectors have exactly the same elements in the same position (when compared with ==)
floor( out, a) List<double>
math.floor the components of a vec3
fromValues(double x, double y, ) List<double>
Creates a new vec3 initialized with the given values
hermite(dynamic out, dynamic a, dynamic b, dynamic c, dynamic d, dynamic t) List<double>
Performs a hermite interpolation with two control points
inverse( out, a) List<double>
Returns the inverse of the components of a vec3
length( a)
Calculates the length of a vec3
lerp( out, a, b, ) List<double>
Performs a linear interpolation between two vec3's
max( out, a, b) List<double>
Returns the maximum of two vec3's
min( out, a, b) List<double>
Returns the minimum of two vec3's
multiply( out, a, b) List<double>
Multiplies two vec3's
negate( out, a) List<double>
Negates the components of a vec3
normalize( out, a) List<double>
Normalize a vec3
random( out, scale) List<double>
Generates a random vector with the given scale
rotateX( out, a, b, double rad) List<double>
Rotate a 3D vector around the x-axis @param {vec3} out The receiving vec3 @param {ReadonlyVec3} a The vec3 point to rotate @param {ReadonlyVec3} b The origin of the rotation @param {Number} rad The angle of rotation in radians @returns {vec3} out
rotateY( out, a, b, double rad) List<double>
Rotate a 3D vector around the y-axis @param {vec3} out The receiving vec3 @param {ReadonlyVec3} a The vec3 point to rotate @param {ReadonlyVec3} b The origin of the rotation @param {Number} rad The angle of rotation in radians @returns {vec3} out
rotateZ( out, a, b, double rad) List<double>
Rotate a 3D vector around the z-axis @param {vec3} out The receiving vec3 @param {ReadonlyVec3} a The vec3 point to rotate @param {ReadonlyVec3} b The origin of the rotation @param {Number} rad The angle of rotation in radians @returns {vec3} out
round( out, a) List<double>
math.round the components of a vec3
scale( out, a, ) List<double>
Scales a vec3 by a scalar number
scaleAndAdd( out, a, b, double scale) List<double>
Adds two vec3's after scaling the second operand by a scalar value
set( out, double x, double y, ) List<double>
Set the components of a vec3 to the given values
slerp( out, a, b, ) List<double>
Performs a spherical linear interpolation between two vec3's
squaredDistance( a, b)
Calculates the squared euclidian distance between two vec3's
squaredLength( a)
Calculates the squared length of a vec3
str(dynamic a)
Returns a string representation of a vector
subtract( out, a, b) List<double>
Subtracts vector b from vector a
transformMat3( out, a, m) List<double>
Transforms the vec3 with a mat3.
transformMat4( out, a, m) List<double>
Transforms the vec3 with a mat4. 4th vector component is implicitly '1'
transformQuat( out, a, q) List<double>
Transforms the vec3 with a quat Can also be used for dual quaternions. (Multiply it with the real part)
zero(dynamic out) List<double>
Set the components of a vec3 to zero