Class Vector.vector


class vector : float -> float -> float -> object .. end
A 3-dimensional vector. I'm reinventing the wheel here but its good practice as I learn OCaml.

I use labeled arguments similar to those in GlMat.

This is a functional class. Methods like Vector.vector.add and Vector.vector.scale return new instances.


val x : float
val y : float
val z : float
method x : float
method y : float
method z : float
method to_tuple : float * float * float
method add : (< add : 'a; cross : 'b -> 'b; eq : 'b -> bool; magnitude : float;
normalize : 'b; print : unit; scale : float -> 'b; sub : 'b -> 'b;
to_string : string; to_tuple : float * float * float; x : float;
y : float; z : float; .. >
as 'b) ->
'b as 'a
method sub : 'b -> 'b
method scale : float -> 'b
method magnitude : float
method cross : 'b -> 'b
method normalize : 'b
method eq : 'b -> bool
method to_string : string
method print : unit