class Mittsu::Vector

Direct Known Subclasses

Defined in:

mittsu/math/vector.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(elements : Array(Float64)) #

[View source]

Instance Method Detail

def ==(v) #
Description copied from class Reference

Returns false (other can only be a Value here).


[View source]
def [](index) #

[View source]
def []=(index, value) #

[View source]
def add(v) #

[View source]
def add_scalar(s) #

[View source]
def add_vectors(a, b) #

[View source]
def angle_to(v) #

[View source]
def ceil #

[View source]
def clamp(min, max) #

[View source]
def clamp_scalar(min, max) #

[View source]
def clone #

[View source]
def copy(v) #

[View source]
def dimensions : Int32 #

[View source]
def distance_to(v) #

[View source]
def divide(v) #

[View source]
def divide_scalar(s) #

[View source]
def each_dimension(&) #

[View source]
def elements : Array(Float64) #

[View source]
def elements=(elements : Array(Float64)) #

[View source]
def floor #

[View source]
def from_array(array, offset = 0) #

[View source]
def index #

[View source]
def index=(index) #

[View source]
def length #

[View source]
def length_sq #

[View source]
def lerp(v, alpha) #

[View source]
def lerp_vectors(v1, v2, alpha) #

[View source]
def max(v) #

[View source]
def min(v) #

[View source]
def multiply(v) #

[View source]
def multiply_scalar(s) #

[View source]
def multiply_vectors(a, b) #

[View source]
def negate #

[View source]
def normalize #

[View source]
def project_on_plane(plane_normal) #

[View source]
def project_on_vector(vector) #

[View source]
def reflect(normal) #

[View source]
def round #

[View source]
def round_to_zero #

[View source]
def set(elements : Array(Float64)) #

[View source]
def set_length(l) #

[View source]
def sub(v) #

[View source]
def sub_scalar(s) #

[View source]
def sub_vectors(a, b) #

[View source]
def to_a(array = [] of Float64, offset = 0) #

alias :to_a :to_array


[View source]
def to_array(array = [] of Float64, offset = 0) #

[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]
def uv #

[View source]
def uv=(uv) #

[View source]