-
-
Notifications
You must be signed in to change notification settings - Fork 1
Vector
Here's an enhanced presentation of your documentation on the Vector Arithmetic Provider:
Embarking on a Vector Odyssey
Step into a realm where vectors reign supreme! The Vector Arithmetic Provider beckons you into the universe of vector mathematics, providing tools tailored for vectorial majesty. While its kin, the Functions Arithmetic Provider, builds upon the foundation of Basic Arithmetic, this particular provider stands apart, catering to the specialized nuances of vector operations.
Unfurling before you are the dimensions supported by the Vector Arithmetic Provider:
-
2D Vectors: Envisioned as
vec2(X, Y)
or simply(X, Y)
-
3D Vectors: Portrayed as
vec3(X, Y, Z)
or(X, Y, Z)
-
4D Vectors: Painted as
vec4(X, Y, Z, W)
or(X, Y, Z, W)
All vector types gracefully waltz through these mathematical operations:
- Addition: The art of combining vectors.
- Subtraction: The elegance of withdrawing vectors.
- Multiplication: The magnificence of scaling vectors.
- Division: The finesse of partitioning vectors.
Dive into the plane of 2D vector mathematics, where you can craft vectors in two distinctive styles:
vec2(X, Y)
(X, Y)
// Vector 2D Illustration
(4, 3)
In this snippet, (4, 3)
brings to life a 2D vector, with X
whispering 4
and Y
murmuring 3
.
// Vector 2D Division Glimpse
(4, 3) / (2, 1.5)
This dance results in the harmonious (2, 2)
.
Vector 2D isn't just about magnitude and direction; it's enchanted with functions like:
- LengthSq
- DistanceSq
- Length
- Distance
- Normalise
- Dot
- AngleBetween
- Cross
- Lerp
Sail into the oceanic expanse of 3D vector mathematics. Conjure these vectors using:
vec3(X, Y, Z)
(X, Y, Z)
// Vector 3D Illustration
(1, 2, 3)
This vignette conjures a 3D vector with X
whispering 1
, Y
singing 2
, and Z
echoing 3
.
Functions for Vector 3 are yet to be etched in the annals of this provider.
Venture into the vast void with 4D vector mathematics. Craft these vectors as:
vec4(X, Y, Z, W)
(X, Y, Z, W)
// Vector 4D Illustration
(1, 2, 3, 4)
In this canvas, (1, 2, 3, 4)
paints a 4D vector with dimensions singing in 1
, 2
, 3
, and 4
.
For the 4D vectors, the magic is weaved through functions like:
- LengthSq
- DistanceSq
- Length
- Distance
- Dot
- Lerp