The mathkit Reference Manual

This is the mathkit Reference Manual, version 0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:59:04 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 mathkit

Various utilities for math

Author

3b

License

MIT

Version

0.0

Dependencies
  • alexandria (system).
  • sb-cga (system).
Source

mathkit.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 mathkit/mathkit.asd

Source

mathkit.asd.

Parent Component

mathkit (system).

ASDF Systems

mathkit.

Packages

mathkit.asdf.


3.1.2 mathkit/package.lisp

Source

mathkit.asd.

Parent Component

mathkit (system).

Packages

kit.math.


3.1.3 mathkit/math.lisp

Dependency

package.lisp (file).

Source

mathkit.asd.

Parent Component

mathkit (system).

Public Interface
Internals

3.1.4 mathkit/quat.lisp

Dependency

math.lisp (file).

Source

mathkit.asd.

Parent Component

mathkit (system).

Internals

3.1.5 mathkit/vector.lisp

Dependency

quat.lisp (file).

Source

mathkit.asd.

Parent Component

mathkit (system).

Public Interface
Internals

define-vecn (macro).


4 Packages

Packages are listed by definition order.


4.1 mathkit.asdf

Source

mathkit.asd.

Use List
  • asdf/interface.
  • common-lisp.

4.2 kit.math

Source

package.lisp.

Use List
  • common-lisp.
  • sb-cga.
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Ordinary functions

Function: copy-matrix (m)
Package

kit.math.

Source

math.lisp.

Function: deg-to-rad (x)

Converts X, a number, from degrees to radians.

Package

kit.math.

Source

math.lisp.

Function: dvec2 (a &rest r)
Package

kit.math.

Source

vector.lisp.

Function: dvec3 (a &rest r)
Package

kit.math.

Source

vector.lisp.

Function: dvec4 (a &rest r)
Package

kit.math.

Source

vector.lisp.

Function: frustum (left right bottom top near far)

Returns a projection matrix that is similar to the glFrustum matrix.

LEFT, RIGHT, BOTTOM, TOP, NEAR and FAR are numbers representing their respective clipping planes. NEAR and FAR must be positive.

Package

kit.math.

Source

math.lisp.

Function: ivec2 (a &rest r)
Package

kit.math.

Source

vector.lisp.

Function: ivec3 (a &rest r)
Package

kit.math.

Source

vector.lisp.

Function: ivec4 (a &rest r)
Package

kit.math.

Source

vector.lisp.

Function: look-at (eye target up)

Returns a view matrix that is similar to the gluLookAt matrix.

EYE and TARGET are both three dimensional coordinate vectors, with the former representing the eye’s location and the latter the center of its viewing target.

UP is a direction vector, representing which way is up for the eye.

Package

kit.math.

Source

math.lisp.

Function: matrix*vec3 (vec matrix)

Apply transformation MATRIX to VEC, return result as a freshly allocated VEC.

Package

kit.math.

Alias for

transform-point.

Function: matrix*vec4 (matrix vector)
Package

kit.math.

Source

math.lisp.

Function: ortho-matrix (left right bottom top near far)

Returns a projection matrix that is similar to the glOrtho matrix.

LEFT, RIGHT, BOTTOM, TOP, NEAR and FAR are numbers representing their respective clipping planes.

Package

kit.math.

Source

math.lisp.

Function: perspective-matrix (fovy aspect z-near z-far)

Returns a projection matrix that is similar to the gluPerspective matrix.

FOVY is the field of view, in degrees.

ASPECT is the aspect ratio of the window, width / height.

Z-NEAR and Z-FAR are positive numbers representing the depth clipping planes.

Package

kit.math.

Source

math.lisp.

Function: rad-to-deg (x)

Converts X, a number, from radians to degrees.

Package

kit.math.

Source

math.lisp.

Function: unproject (point model-matrix perspective-matrix viewport)
Package

kit.math.

Source

math.lisp.

Function: vec2 (a &rest r)
Package

kit.math.

Source

vector.lisp.

Function: vec3 (a &rest r)
Package

kit.math.

Source

vector.lisp.

Function: vec4 (a &rest r)
Package

kit.math.

Source

vector.lisp.


5.1.2 Types

Type: dvec2 ()
Package

kit.math.

Source

vector.lisp.

Type: dvec3 ()
Package

kit.math.

Source

vector.lisp.

Type: dvec4 ()
Package

kit.math.

Source

vector.lisp.

Type: ivec2 ()
Package

kit.math.

Source

vector.lisp.

Type: ivec3 ()
Package

kit.math.

Source

vector.lisp.

Type: ivec4 ()
Package

kit.math.

Source

vector.lisp.

Type: vec2 ()
Package

kit.math.

Source

vector.lisp.

Type: vec3 ()
Package

kit.math.

Source

vector.lisp.

Type: vec4 ()
Package

kit.math.

Source

vector.lisp.


5.2 Internals


5.2.1 Macros

Macro: define-vecn (n type &optional prefix)
Package

kit.math.

Source

vector.lisp.

Macro: defun-qrot (nname name index &optional post)
Package

kit.math.

Source

quat.lisp.

Macro: floatify ((&rest symbols) &body body)
Package

kit.math.

Source

math.lisp.


5.2.2 Ordinary functions

Function: %nq* (a1 a2 a3 a4 b1 b2 b3 b4)

multiply 2 quaternions with elements A{1..4} and B{1..4}, returning result as multiple values.

Package

kit.math.

Source

quat.lisp.

Function: %quat* (a b dest)

multiply quaternions A and B storing result into DEST.

Package

kit.math.

Source

quat.lisp.

Function: angle-axis->dquaternion (angle-radians axis)

create a quaternion from specified axis and angle in radians

Package

kit.math.

Source

quat.lisp.

Function: angle-axis->quaternion (angle-radians axis)

create a quaternion from specified axis and angle in radians

Package

kit.math.

Source

quat.lisp.

Function: copy-quaternion (q)
Package

kit.math.

Source

quat.lisp.

Function: dquat* (a b &rest rest)

multiply quaternions A and B returning result as a new quaternion.

Package

kit.math.

Source

quat.lisp.

Function: dquaternion (w x y z)

Allocate dquaternion [W, Xi, Yj, Zk].

Package

kit.math.

Source

quat.lisp.

Function: nqlerp (a b f)
Package

kit.math.

Source

quat.lisp.

Function: q-nrotate-local-x (quat angle dest)
Package

kit.math.

Source

quat.lisp.

Function: q-nrotate-local-y (quat angle dest)
Package

kit.math.

Source

quat.lisp.

Function: q-nrotate-local-z (quat angle dest)
Package

kit.math.

Source

quat.lisp.

Function: q-nrotate-world-x (quat angle dest)
Package

kit.math.

Source

quat.lisp.

Function: q-nrotate-world-y (quat angle dest)
Package

kit.math.

Source

quat.lisp.

Function: q-nrotate-world-z (quat angle dest)
Package

kit.math.

Source

quat.lisp.

Function: q-rotate-local-x (quat angle)
Package

kit.math.

Source

quat.lisp.

Function: q-rotate-local-y (quat angle)
Package

kit.math.

Source

quat.lisp.

Function: q-rotate-local-z (quat angle)
Package

kit.math.

Source

quat.lisp.

Function: q-rotate-world-x (quat angle)
Package

kit.math.

Source

quat.lisp.

Function: q-rotate-world-y (quat angle)
Package

kit.math.

Source

quat.lisp.

Function: q-rotate-world-z (quat angle)
Package

kit.math.

Source

quat.lisp.

Function: qi (q)
Package

kit.math.

Source

quat.lisp.

Function: qj (q)
Package

kit.math.

Source

quat.lisp.

Function: qk (q)
Package

kit.math.

Source

quat.lisp.

Function: quat* (a b &rest rest)

multiply quaternions A and B returning result as a new quaternion.

Package

kit.math.

Source

quat.lisp.

Function: quat+ (a b)
Package

kit.math.

Source

quat.lisp.

Function: quat- (a b)
Package

kit.math.

Source

quat.lisp.

Function: quat->axis-angle (q)
Package

kit.math.

Source

quat.lisp.

Function: quat-inverse (quat)
Package

kit.math.

Source

quat.lisp.

Function: quat-rotate-matrix (quat &optional matrix)
Package

kit.math.

Source

quat.lisp.

Function: quat-rotate-vector (quat vec)

rotate a vector VEC using specifed rotation quaternion Q, returning result as a new single-float vector.

Package

kit.math.

Source

quat.lisp.

Function: quaternion (w x y z)

Allocate quaternion [W, Xi, Yj, Zk].

Package

kit.math.

Source

quat.lisp.

Function: qw (q)
Package

kit.math.

Source

quat.lisp.

Function: v (l)
Package

kit.math.

Source

math.lisp.

Function: vx (v)
Package

kit.math.

Source

quat.lisp.

Function: vy (v)
Package

kit.math.

Source

quat.lisp.

Function: vz (v)
Package

kit.math.

Source

quat.lisp.


5.2.3 Types

Type: dquaternion ()

A quaternion of double floats. [W, Xi, Yj, Zk]

Package

kit.math.

Source

quat.lisp.

Type: quaternion ()

A quaternion of single floats. [W, Xi, Yj, Zk]

Package

kit.math.

Source

quat.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %  
A   C   D   F   I   L   M   N   O   P   Q   R   U   V  
Index Entry  Section

%
%nq*: Private ordinary functions
%quat*: Private ordinary functions

A
angle-axis->dquaternion: Private ordinary functions
angle-axis->quaternion: Private ordinary functions

C
copy-matrix: Public ordinary functions
copy-quaternion: Private ordinary functions

D
define-vecn: Private macros
defun-qrot: Private macros
deg-to-rad: Public ordinary functions
dquat*: Private ordinary functions
dquaternion: Private ordinary functions
dvec2: Public ordinary functions
dvec3: Public ordinary functions
dvec4: Public ordinary functions

F
floatify: Private macros
frustum: Public ordinary functions
Function, %nq*: Private ordinary functions
Function, %quat*: Private ordinary functions
Function, angle-axis->dquaternion: Private ordinary functions
Function, angle-axis->quaternion: Private ordinary functions
Function, copy-matrix: Public ordinary functions
Function, copy-quaternion: Private ordinary functions
Function, deg-to-rad: Public ordinary functions
Function, dquat*: Private ordinary functions
Function, dquaternion: Private ordinary functions
Function, dvec2: Public ordinary functions
Function, dvec3: Public ordinary functions
Function, dvec4: Public ordinary functions
Function, frustum: Public ordinary functions
Function, ivec2: Public ordinary functions
Function, ivec3: Public ordinary functions
Function, ivec4: Public ordinary functions
Function, look-at: Public ordinary functions
Function, matrix*vec3: Public ordinary functions
Function, matrix*vec4: Public ordinary functions
Function, nqlerp: Private ordinary functions
Function, ortho-matrix: Public ordinary functions
Function, perspective-matrix: Public ordinary functions
Function, q-nrotate-local-x: Private ordinary functions
Function, q-nrotate-local-y: Private ordinary functions
Function, q-nrotate-local-z: Private ordinary functions
Function, q-nrotate-world-x: Private ordinary functions
Function, q-nrotate-world-y: Private ordinary functions
Function, q-nrotate-world-z: Private ordinary functions
Function, q-rotate-local-x: Private ordinary functions
Function, q-rotate-local-y: Private ordinary functions
Function, q-rotate-local-z: Private ordinary functions
Function, q-rotate-world-x: Private ordinary functions
Function, q-rotate-world-y: Private ordinary functions
Function, q-rotate-world-z: Private ordinary functions
Function, qi: Private ordinary functions
Function, qj: Private ordinary functions
Function, qk: Private ordinary functions
Function, quat*: Private ordinary functions
Function, quat+: Private ordinary functions
Function, quat-: Private ordinary functions
Function, quat->axis-angle: Private ordinary functions
Function, quat-inverse: Private ordinary functions
Function, quat-rotate-matrix: Private ordinary functions
Function, quat-rotate-vector: Private ordinary functions
Function, quaternion: Private ordinary functions
Function, qw: Private ordinary functions
Function, rad-to-deg: Public ordinary functions
Function, unproject: Public ordinary functions
Function, v: Private ordinary functions
Function, vec2: Public ordinary functions
Function, vec3: Public ordinary functions
Function, vec4: Public ordinary functions
Function, vx: Private ordinary functions
Function, vy: Private ordinary functions
Function, vz: Private ordinary functions

I
ivec2: Public ordinary functions
ivec3: Public ordinary functions
ivec4: Public ordinary functions

L
look-at: Public ordinary functions

M
Macro, define-vecn: Private macros
Macro, defun-qrot: Private macros
Macro, floatify: Private macros
matrix*vec3: Public ordinary functions
matrix*vec4: Public ordinary functions

N
nqlerp: Private ordinary functions

O
ortho-matrix: Public ordinary functions

P
perspective-matrix: Public ordinary functions

Q
q-nrotate-local-x: Private ordinary functions
q-nrotate-local-y: Private ordinary functions
q-nrotate-local-z: Private ordinary functions
q-nrotate-world-x: Private ordinary functions
q-nrotate-world-y: Private ordinary functions
q-nrotate-world-z: Private ordinary functions
q-rotate-local-x: Private ordinary functions
q-rotate-local-y: Private ordinary functions
q-rotate-local-z: Private ordinary functions
q-rotate-world-x: Private ordinary functions
q-rotate-world-y: Private ordinary functions
q-rotate-world-z: Private ordinary functions
qi: Private ordinary functions
qj: Private ordinary functions
qk: Private ordinary functions
quat*: Private ordinary functions
quat+: Private ordinary functions
quat-: Private ordinary functions
quat->axis-angle: Private ordinary functions
quat-inverse: Private ordinary functions
quat-rotate-matrix: Private ordinary functions
quat-rotate-vector: Private ordinary functions
quaternion: Private ordinary functions
qw: Private ordinary functions

R
rad-to-deg: Public ordinary functions

U
unproject: Public ordinary functions

V
v: Private ordinary functions
vec2: Public ordinary functions
vec3: Public ordinary functions
vec4: Public ordinary functions
vx: Private ordinary functions
vy: Private ordinary functions
vz: Private ordinary functions


A.3 Variables