struct VectorMath::Vec3

Overview

An immutable set of x/y/z coordinates

Defined in:

vector_math/vectors.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(x : Float64 = 0.0, y : Float64 = 0.0, z : Float64 = 0.0) #

[View source]
def self.new(values : Array(Float64)) #

[View source]

Class Method Detail

def self.unit #

[View source]
def self.x_unit #

[View source]
def self.y_unit #

[View source]
def self.z_unit #

[View source]

Instance Method Detail

def *(scalar) #

[View source]
def +(other) #

[View source]
def -(other) #

[View source]
def /(scalar) #

[View source]
def mag #

[View source]
def normalize #

[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 to_vec2 #

throw away the z component


[View source]
def to_vec4 #

add w=1.0


[View source]
def x : Float64 #

[View source]
def y : Float64 #

[View source]
def z : Float64 #

[View source]