class RayTracer::Matrix
- RayTracer::Matrix
- Reference
- Object
Included Modules
Extended Modules
Defined in:
ray_tracer/matrix.crConstant Summary
-
IDENTITY_4 =
identity(4)
Constructors
Class Method Summary
- .identity(size)
- .rotation_x(r)
- .rotation_y(r)
- .rotation_z(r)
- .scaling(x, y, z)
- .shearing(x_y, x_z, y_x, y_z, z_x, z_y)
- .translation(x, y, z)
- .view_transform(from : TUPLE, to : TUPLE, up : TUPLE)
Instance Method Summary
- #*(other : Matrix)
- #*(tuple : Tuple::TUPLE)
-
#==(other)
Returns
false
(other can only be aValue
here). - #[](row, col)
- #cofactor(row, col)
- #col(num)
- #cols
- #det
- #determinant
- #inverse
- #invertable?
- #minor(row, col)
- #rotation_x(r)
- #rotation_y(r)
- #rotation_z(r)
- #row(num)
- #rows
- #scaling(x, y, z)
- #shearing(x_y, x_z, y_x, y_z, z_x, z_y)
- #size
- #submatrix(row, col)
-
#to_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
-
#translation(x, y, z)
Fluent transforms
- #transpose
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
Class Method Detail
Instance Method Detail
def ==(other)
#
Description copied from class Reference
Returns false
(other can only be a Value
here).
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>