mirror of
https://github.com/visgl/luma.gl.git
synced 2025-12-08 17:36:19 +00:00
29 lines
1.0 KiB
Markdown
29 lines
1.0 KiB
Markdown
# Vector Classes
|
|
|
|
Two, three and four dimensional vector classes
|
|
|
|
## Vector2, Vector3, Vector4 Methods
|
|
|
|
| **Method** | **Description** |
|
|
| --- | --- |
|
|
| `constructor` | Creates a Vector2 |
|
|
| `ELEMENTS` | Get the dimensionality of the vector |
|
|
| `x` | Set/get x component |
|
|
| `y` | Set/get y component |
|
|
| `z` | Set/get z component (`Vector3` only) |
|
|
| `w` | Set/get w component (`Vector4` only) |
|
|
| `set` | Set values |
|
|
| `add` | Vectors addition |
|
|
| `subtract` | Vectors subtraction |
|
|
| `multiply` | Vectors multiplication |
|
|
| `divide` | Vectors division |
|
|
| `scale` | Scales a Vector by a scalar number |
|
|
| `scaleAndAdd` | Adds two vectors after scaling the second operand by a scalar value |
|
|
| `negate` | Negate a vector |
|
|
| `inverse` | Inverse a vector (`Vector3` and `Vector4` only |
|
|
| `normalize` | Normalize a vector |
|
|
| `dot` | Dot product of two vectors |
|
|
| `cross` | Cross product of two vectors (`Vector3` only) |
|
|
| `lerp` | Linear interpolation between two Vector |
|
|
| `operation` | Apply general operations on all vectors |
|