Difference between revisions of "Vector library"
| Line 19: | Line 19: | ||
[[vector.cross]] ''computes the cross product of two vectors''<br/><!--GIDEROSMTD:vector.cross(vec1,vec2) computes the cross product of two vectors--> | [[vector.cross]] ''computes the cross product of two vectors''<br/><!--GIDEROSMTD:vector.cross(vec1,vec2) computes the cross product of two vectors--> | ||
[[vector.dot]] ''computes the dot product of two vectors''<br/><!--GIDEROSMTD:vector.dot(vec1,vec2) computes the dot product of two vectors--> | [[vector.dot]] ''computes the dot product of two vectors''<br/><!--GIDEROSMTD:vector.dot(vec1,vec2) computes the dot product of two vectors--> | ||
| + | [[vector.floor]] ''applies math.floor to every component of the input vector''<br/><!--GIDEROSMTD:vector.floor(vec) applies math.floor to every component of the input vector--> | ||
[[vector.magnitude]] ''calculates the magnitude of a given vector''<br/><!--GIDEROSMTD:vector.magnitude(vec) calculates the magnitude of a given vector--> | [[vector.magnitude]] ''calculates the magnitude of a given vector''<br/><!--GIDEROSMTD:vector.magnitude(vec) calculates the magnitude of a given vector--> | ||
[[vector.normalize]] ''computes the normalized version of a given vector''<br/><!--GIDEROSMTD:vector.normalize(vec) computes the normalized version of a given vector--> | [[vector.normalize]] ''computes the normalized version of a given vector''<br/><!--GIDEROSMTD:vector.normalize(vec) computes the normalized version of a given vector--> | ||
Latest revision as of 11:14, 2 February 2026
Supported platforms: ![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Available since: Gideros 2026.1
Description
This library implements functionality for the vector type in addition to the built-in primitive operator support. Default Gideros configuration uses vectors with 3 components (x, y, and z).
Individual vector components can be accessed using the fields x or X, y or Y, z or Z. Since vector values are immutable, writes to individual components are not supported.
Reference
https://luau.org/library/#vector-library
Methodsvector.angle computes the angle between two vectors in radians |
EventsConstants |