struct CrystalEdge::Vector2
- CrystalEdge::Vector2
- Struct
- Value
- Object
Overview
Representation of 2D vector
Defined in:
crystaledge/vector2.crConstructors
Class Method Summary
-
.zero
Zero vector
Instance Method Summary
- #!=(other : Vector2)
-
#%(other : Vector2)
Alias for cross product
-
#*(other : Vector2)
Performs component multiplication (for dot product see
#dot
) -
#*(other : Float64)
Performs multiplication
-
#**(other : Vector2)
Alias for dot product
-
#+(other : Vector2)
Performs component addition
-
#+(other : Float64)
Performs component addition
-
#-(other : Vector2)
Performs component subtraction
-
#-(other : Float64)
Performs component subtraction
-
#-
Returns negated vector
-
#/(other : Vector2)
Performs component division
-
#/(other : Float64)
Performs division
- #==(other : Vector2)
-
#angle(other : Vector2)
Returns angle between two vectors
-
#angle
Returns direction of a vector
-
#clone
Clones this vector and passes it into a block if given
-
#clone(&b)
ditto
-
#cross(other : Vector2)
Returns cross product of two vectors
-
#distance(other : Vector2)
Finds distance between two vectors
-
#dot(other : Vector2)
Returns dot product of two vectors
-
#find_normal_axis(other : Vector2)
Finds normal axis between two vectors
-
#heading
ditto
-
#magnitude
Returns magnitude of this vector
-
#normalize
Non-aggressive version of
#normalize!
-
#normalize!
Normalizes current vector
-
#to_s
Formats vector
-
#values
Converts vector to a tuple of values
- #x : Float64
- #x=(x : Float64)
- #y : Float64
- #y=(y : Float64)
-
#zero!
Fills current vector with zero