Vector2DMixin :Dot()
Jump to navigation
Jump to search
- These functions are implemented in
and:Dot FrameXML/Vector2D.lua FrameXML/Vector3D.lua
.
- These functions are implemented in
Computes the dot product of one vector with another or itself.
vector:Dot(other) vector:GetLengthSquared()
Arguments
- other
- table - A Vector2DMixin or Vector3DMixin (must be the same kind as the original vector).
Details
- GetLengthSquared() is equivalent to
vector:Dot(vector)
, resulting in the sum of the squares of its coordinates.
Example
local vector = CreateVector2D(3, 4)
print vector:GetLengthSquared() -- 25
Patch changes
- Patch 7.2.0 (2017-03-28): Added.[1][2]
External links
- Dot product on Wikipedia.
References
- ^ 2017-03-28, Vector2D.lua, version 7.2.0.23835, near line 94, archived at Townlong-Yak
- ^ 2017-03-28, Vector3D.lua, version 7.2.0.23835, near line 102, archived at Townlong-Yak