## Math

Defaults

math.scientific false // scientific_notation : false; {true: 1E3 false: 1000 – simpler }
math.decimal true // decimal_separator : true; {true: 1.234 (en) false: 1,234 (other)}
math.digit false // digit_grouping : false; {true: 1,000,000 or 1.000.000 false: 1000000 – simpler}
math.leading 0 // leading_zero : 0; { (1 0.1) or (01 00.1) or 001 or 0001 }
math.trailing 0 // trailing_zero : 0; { 1.000 or 1.00 or 1.0 or 1 }
math.degree true // degree : true; {true: 1° false: 1 rad }
math.vector false // vector : false; {true: <1, 1, 1> false: 1, 1, 1}
math.matrix false // matrix : false; {true: […] false: …}}

Constants

math.2*pi // 6.28318530718
math.360° // 6.28318530718
math.pi // 3.14159265359
math.180° // 3.14159265359
math.pi/2 // 1.57079632679
math.90° // 1.57079632679
math.pi/4 // 0.785398163397
math.45° // 0.785398163397

Functions

variable := math.minnorm <-1, -2, -3>
{variable = <0.3333, 0.6666, 1>}

variable := math.norm <1, 2, 3>
{variable = <0.2672612419124244, 0.5345224838248488, 0.8017837257372732>}

variable := math.maxnorm <1, 2, 3>
{variable = <0.3333, 0.6666, 1>}

Matrix & Quaternion functions

Matrix3 : x y z x y z x y z
Matrix3 : <x, y, z> <x, y, z> <x, y, z>
Matrix3 : (<x, y, z>;<x, y, z>;<x, y, z>)
Matrix4 : x y z t x y z t x y z t x y z t
Matrix4 : <x, y, z, t> <x, y, z, t> <x, y, z, t> <x, y, z, t>
Matrix4 : (<x, y, z, t>;<x, y, z, t>;<x, y, z, t>;<x, y, z, t>)
Quaternion: <r, i, j, k>

variable := matrix2quat <1,2,3> <4,5,6> <7,8,9> // import vector or space style
{variable = <2, -0.25, 0.5, -0.25>}
variable := quat2matrix <2, -0.25, 0.5, -0.25>
{variable = (<3.75, -1.25, -1.875>;<0.75, 4.125, -1.25>;<2.125, 0.75, 3.75>)}

variable := quat 3.1415926535897931 <0.0161374306091976, 0.06454972243679, 0.0161374306091976>
{variable = <0, 0.2357022603955171, 0.9428090415820627, 0.2357022603955171>}
variable := quat.vector <2, -0.25, 0.5, -0.25>
{variable = <0.0161374306091976, 0.06454972243679, 0.0161374306091976>}
variable := quat.angle <2, -0.25, 0.5, -0.25>
{variable = 3.1415926535897931}
variable := quat.conjugate <2, -0.25, 0.5, -0.25>
{variable = <2, 0.25, -0.5, 0.25>}

variable := quat.mul
variable := quat.join
variable := quat.transform

variable := matrix.trace <1,2,3> <4,5,6> <7,8,9>
{variable = <1, 5, 9, 1>}
variable := matrix.v1 <1,2,3> <4,5,6> <7,8,9>
{variable = <1, 2, 3, 0>}
variable := matrix.v2 <1,2,3> <4,5,6> <7,8,9>
{variable = <4, 5, 6, 0>}
variable := matrix.v3 <1,2,3> <4,5,6> <7,8,9>
{variable = <7, 8, 9, 0>}
variable := matrix.v4 <1,2,3> <4,5,6> <7,8,9>
{variable = <0, 0, 0, 1>}

variable := matrix.rotation <1,2,3,0> <4,5,6,0> <7,8,9,0> <2,3,5,1>
{variable = (<1, 2, 3>;<4, 5, 6>;<7, 8, 9>)}
variable := matrix.scale <1,2,3,0> <4,5,6,0> <7,8,9,0> <2,3,5,1>
{variable = <3.7416573867739413, 8.7749643873921226, 13.928388277184119>}
variable := matrix.move <1,2,3,0> <4,5,6,0> <7,8,9,0> <2,3,5,1>
{variable = <2, 3, 5>}

variable := matrix <1,0,0> <0,1,0> <0,0,1> <0.5,0.5,0.5> <2,10,2> // split vector style
{variable = (<0.5, 0, 0, 0>;<0, 0.5, 0, 0>;<0, 0, 0.5, 0>;<2, 10, 2, 1>)}
variable := matrix.vector <1,0,0> <0,1,0> <0,0,1> <0.5,0.5,0.5> <2,10,2> // split vector style
{variable = <0.5, 0, 0, 0> <0, 0.5, 0, 0> <0, 0, 0.5, 0> <2, 10, 2, 1>}
variable := matrix.space <1,0,0> <0,1,0> <0,0,1> <0.5,0.5,0.5> <2,10,2> // split vector style
{variable = 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 2 10 2 1}