package scad_ml

  1. Overview
  2. Docs

Module Scad_ml.RotMatrixSource

A rotation matrix.

Used in conjunction with Quaternion to provide an additional means of rotating OpenSCAD objects and vectors (Vec3.t).

Sourcetype t = private float array array
Sourceval of_row_list_exn : (float * float * float) list -> t

of_row_list_exn l

Create a rotation matrix from a list l of three rows. Throws an exception if l is not the correct length.

Sourceval of_row_list : (float * float * float) list -> (t, string) result
Sourceval of_col_list_exn : (float * float * float) list -> t

of_col_list_exn l

Create a rotation matrix from a list l of three columns. Throws an exception if l is not the correct length.

Sourceval of_col_list : (float * float * float) list -> (t, string) result
Sourceval align_exn : Vec3.t -> Vec3.t -> t

align_exn a b

Calculate a rotation matrix that would bring a into alignment with b. Throws an exception if the vectors are equal or zero.

Sourceval align : Vec3.t -> Vec3.t -> (t, string) result
Sourceval to_euler : t -> Vec3.t

to_euler t

Convert t to an equivalent (x, y, z) euler rotation vector.

Sourceval trace : t -> float

trace t

Sum the elements on the main diagonal (upper left to lower right) of t.

Sourceval get : t -> int -> int -> float

get t r c

Get the element at row and column of t. Equivalent to t.(r).(c).

Sourceval mul : t -> t -> t
Sourceval add : t -> t -> t
Sourceval sub : t -> t -> t
Sourceval transpose : t -> t
Sourceval map : (float -> float) -> t -> t
Sourceval mul_scalar : t -> float -> t
Sourceval div_scalar : t -> float -> t
Sourceval add_scalar : t -> float -> t
Sourceval sub_scalar : t -> float -> t
OCaml

Innovation. Community. Security.