class Mittsu::Vector2

Defined in:

mittsu/math/vector2.cr

Constructors

Instance Method Summary

Instance methods inherited from class Mittsu::Vector

==(v) ==, [](index) [], []=(index, value) []=, add(v) add, add_scalar(s) add_scalar, add_vectors(a, b) add_vectors, angle_to(v) angle_to, ceil ceil, clamp(min, max) clamp, clamp_scalar(min, max) clamp_scalar, clone clone, copy(v) copy, dimensions : Int32 dimensions, distance_to(v) distance_to, divide(v) divide, divide_scalar(s) divide_scalar, each_dimension(&) each_dimension, elements : Array(Float64) elements, elements=(elements : Array(Float64)) elements=, floor floor, from_array(array, offset = 0) from_array, index index, index=(index) index=, length length, length_sq length_sq, lerp(v, alpha) lerp, lerp_vectors(v1, v2, alpha) lerp_vectors, max(v) max, min(v) min, multiply(v) multiply, multiply_scalar(s) multiply_scalar, multiply_vectors(a, b) multiply_vectors, negate negate, normalize normalize, project_on_plane(plane_normal) project_on_plane, project_on_vector(vector) project_on_vector, reflect(normal) reflect, round round, round_to_zero round_to_zero, set(elements : Array(Float64)) set, set_length(l) set_length, sub(v) sub, sub_scalar(s) sub_scalar, sub_vectors(a, b) sub_vectors, to_a(array = [] of Float64, offset = 0) to_a, to_array(array = [] of Float64, offset = 0) to_array, to_s to_s, uv uv, uv=(uv) uv=

Constructor methods inherited from class Mittsu::Vector

new(elements : Array(Float64)) new

Constructor Detail

def self.new(x = 0, y = 0) #

[View source]

Instance Method Detail

def distance_to_squared(v) #

[View source]
def dot(v) #

[View source]
def from_attribute(attribute, index, offset = 0) #

[View source]
def set(x, y) #

[View source]
def x #

[View source]
def x=(value) #

[View source]
def y #

[View source]
def y=(value) #

[View source]