class RayTracer::Matrix

Included Modules

Extended Modules

Defined in:

ray_tracer/matrix.cr

Constant Summary

IDENTITY_4 = identity(4)

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module RayTracer::Tuple

add(a1 : TUPLE, a2 : TUPLE) add, cross(a1 : TUPLE, a2 : TUPLE) cross, divide(a : TUPLE, s : Float64) divide, dot(a1 : TUPLE, a2 : TUPLE) dot, magnitude(a : TUPLE) magnitude, multiply(a : TUPLE, s : Float64) multiply, negate(a : TUPLE) negate, normalize(a : TUPLE) normalize, point(x : Float64, y : Float64, z : Float64) point, point?(tuple : TUPLE) point?, reflect(v : TUPLE, n : TUPLE) reflect, subtract(a1 : TUPLE, a2 : TUPLE) subtract, tuple(x : Float64, y : Float64, z : Float64, w : Float64)
tuple(vals : Array(Float64))
tuple
, vector(x : Float64, y : Float64, z : Float64) vector, vector?(tuple : TUPLE) vector?

Constructor Detail

def self.new(vals : Array(Array(Float64) | Array(Int32))) #

[View source]
def self.new(tuple : Tuple::TUPLE, column = true) #

[View source]

Class Method Detail

def self.identity(size) #

[View source]
def self.rotation_x(r) #

[View source]
def self.rotation_y(r) #

[View source]
def self.rotation_z(r) #

[View source]
def self.scaling(x, y, z) #

[View source]
def self.shearing(x_y, x_z, y_x, y_z, z_x, z_y) #

[View source]
def self.translation(x, y, z) #

[View source]
def self.view_transform(from : TUPLE, to : TUPLE, up : TUPLE) #

[View source]

Instance Method Detail

def *(other : Matrix) #

[View source]
def *(tuple : Tuple::TUPLE) #

[View source]
def ==(other) #
Description copied from class Reference

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


[View source]
def [](row, col) #

[View source]
def cofactor(row, col) #

[View source]
def col(num) #

[View source]
def cols #

[View source]
def det #

[View source]
def determinant #

[View source]
def inverse #

[View source]
def invertable? #

[View source]
def minor(row, col) #

[View source]
def rotation_x(r) #

[View source]
def rotation_y(r) #

[View source]
def rotation_z(r) #

[View source]
def row(num) #

[View source]
def rows #

[View source]
def scaling(x, y, z) #

[View source]
def shearing(x_y, x_z, y_x, y_z, z_x, z_y) #

[View source]
def size #

[View source]
def submatrix(row, col) #

[View source]
def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def translation(x, y, z) #

Fluent transforms


[View source]
def transpose #

[View source]