Representation of 2D vector
Constructors
new(x : Float64, y : Float64)
Initializes vector with x and y
SourceInstance methods
*(other : Vector2)
Performs component multiplication (for dot product see #dot)
Source+(other : Vector2)
Performs component addition
Source+(other : Float64)
Performs component addition
Source-(other : Vector2)
Performs component subtraction
Source-(other : Float64)
Performs component subtraction
Source/(other : Vector2)
Performs component division
Sourceangle(other : Vector2)
Returns angle between two vectors
Sourceangle
Returns direction of a vector
Sourceclone
Clones this vector and passes it into a block if given
Sourcecross(other : Vector2)
Returns cross product of two vectors
Sourcedistance(other : Vector2)
Finds distance between two vectors
Sourcedot(other : Vector2)
Returns dot product of two vectors
Sourcefind_normal_axis(other : Vector2)
Finds normal axis between two vectors
Sourcemagnitude
Returns magnitude of this vector
Sourcenormalize
Non-aggressive version of #normalize!
Sourcenormalize!
Normalizes current vector
Sourcevalues
Converts vector to a tuple of values
Sourcezero!
Fills current vector with zero
Source