Module beagle::vec
[−]
[src]
An array of Scalars, written Vec<D, V>
but pronounced 'vector'.
Vectors support binary operations between two Vectors or between one Vector and one Scalar. All Arithmetic operators and Bitwise operators are supported, where the two Scalar types involved support the operation. All operations operate on each component separately.
Vectors also support Negation and Logical Negation where the underlying Scalar Type supports it.
Examples
use beagle::vec::{Vec3}; let v1 = Vec3::new([2f32, 3f32, 5f32]); let v2 = Vec3::new([7f32, 11f32, 13f32]); assert_eq!(v1+v2, Vec3::new([9f32, 14f32, 18f32]));
Structs
Vec |
An array of Scalars, written |
Functions
cross |
Returns the cross product of |
distance |
Returns the distance between |
distance2 |
Returns the distance squared between |
dot |
Multiply two Vectors component-wise, summing the results. Known as a dot product. |
faceforward |
Returns |
is_perpendicular |
Returns |
length |
Returns the length of |
length2 |
Returns the length squared of |
normalize |
Returns an approximated normalized version of |
normalize_exact |
Returns an exact normalized version of |
reflect |
Reflects |
Type Definitions
Vec1 |
An alias for Vec<One, V> |
Vec2 |
An alias for Vec<One, V> |
Vec3 |
An alias for Vec<One, V> |
Vec4 |
An alias for Vec<One, V> |