The rtg-math Reference Manual

This is the rtg-math Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:37:47 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 rtg-math

A selection of the math routines most commonly needed for realtime graphics in lisp

Author

Chris Bagley <>

License

BSD 2 Clause

Dependencies
  • alexandria (system).
  • glsl-symbols (system).
  • documentation-utils (system).
Source

rtg-math.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 rtg-math/rtg-math.asd

Source

rtg-math.asd.

Parent Component

rtg-math (system).

ASDF Systems

rtg-math.


3.1.3 rtg-math/utils.lisp

Dependency

package.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.4 rtg-math/deftypes.lisp

Dependency

utils.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.5 rtg-math/base-maths.lisp

Dependency

deftypes.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.6 rtg-math/vectors/base/base-vectors.lisp

Dependency

base-maths.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.7 rtg-math/vectors/vector2/non-consing.lisp

Dependency

vectors/base/base-vectors.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
  • * (compiler macro).
  • * (function).
  • *s (function).
  • + (compiler macro).
  • + (function).
  • +s (function).
  • - (compiler macro).
  • - (function).
  • -s (function).
  • / (function).
  • /s (function).
  • negate (function).
  • normalize (function).
  • rotate (function).
  • set-components (function).
Internals

3.1.8 rtg-math/vectors/vector2/consing.lisp

Dependency

vectors/vector2/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.9 rtg-math/vectors/vector3/non-consing.lisp

Dependency

vectors/vector2/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
  • * (compiler macro).
  • * (function).
  • *s (function).
  • + (compiler macro).
  • + (function).
  • +s (function).
  • - (compiler macro).
  • - (function).
  • -s (function).
  • / (function).
  • /s (function).
  • negate (function).
  • normalize (function).
  • rotate (function).
  • set-components (function).
Internals

3.1.10 rtg-math/vectors/vector3/consing.lisp

Dependency

vectors/vector3/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.11 rtg-math/vectors/vector4/non-consing.lisp

Dependency

vectors/vector3/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
  • * (compiler macro).
  • * (function).
  • *s (function).
  • + (compiler macro).
  • + (function).
  • +s (function).
  • - (compiler macro).
  • - (function).
  • -s (function).
  • / (function).
  • /s (function).
  • negate (function).
  • normalize (function).
  • set-components (function).
Internals

3.1.12 rtg-math/vectors/vector4/consing.lisp

Dependency

vectors/vector4/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.13 rtg-math/vectors/vectors.lisp

Dependency

vectors/vector4/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.14 rtg-math/matrices/matrix2/common.lisp

Dependency

vectors/vectors.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.15 rtg-math/matrices/matrix2/non-consing.lisp

Dependency

matrices/matrix2/common.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.16 rtg-math/matrices/matrix2/consing.lisp

Dependency

matrices/matrix2/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

%* (function).


3.1.17 rtg-math/matrices/matrix3/common.lisp

Dependency

matrices/matrix2/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.18 rtg-math/matrices/matrix3/non-consing.lisp

Dependency

matrices/matrix3/common.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.19 rtg-math/matrices/matrix3/consing.lisp

Dependency

matrices/matrix3/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

%* (function).


3.1.20 rtg-math/matrices/matrix4/common.lisp

Dependency

matrices/matrix3/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.21 rtg-math/matrices/matrix4/non-consing.lisp

Dependency

matrices/matrix4/common.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.22 rtg-math/matrices/matrix4/consing.lisp

Dependency

matrices/matrix4/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.23 rtg-math/matrices/base/base-matrices.lisp

Dependency

matrices/matrix4/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
  • m! (compiler macro).
  • m! (function).
Internals

m!one-arg (function).


3.1.24 rtg-math/matrices/matrices.lisp

Dependency

matrices/base/base-matrices.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

melm (function).


3.1.25 rtg-math/quaternions/common.lisp

Dependency

matrices/matrices.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.26 rtg-math/quaternions/non-consing.lisp

Dependency

quaternions/common.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.27 rtg-math/quaternions/consing.lisp

Dependency

quaternions/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.28 rtg-math/projection/orthographic/non-consing.lisp

Dependency

quaternions/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.29 rtg-math/projection/orthographic/consing.lisp

Dependency

projection/orthographic/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.30 rtg-math/projection/perspective/non-consing.lisp

Dependency

projection/orthographic/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.31 rtg-math/projection/perspective/consing.lisp

Dependency

projection/perspective/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.32 rtg-math/polar-coords/polar.lisp

Dependency

projection/perspective/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.33 rtg-math/spherical-coords/spherical.lisp

Dependency

polar-coords/polar.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

unit-spherical->unit-cartesian (function).


3.1.34 rtg-math/regions/line3/consing.lisp

Dependency

spherical-coords/spherical.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals
  • /= (function).
  • = (function).

3.1.35 rtg-math/regions/ray3/consing.lisp

Dependency

regions/line3/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.36 rtg-math/regions/line-segment3/consing.lisp

Dependency

regions/ray3/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface
Internals

3.1.37 rtg-math/regions/aab/common.lisp

Dependency

regions/line-segment3/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

with-aab (macro).


3.1.38 rtg-math/regions/aab/non-consing.lisp

Dependency

regions/aab/common.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

merge-point (function).


3.1.39 rtg-math/regions/aab/consing.lisp

Dependency

regions/aab/non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.40 rtg-math/regions/regions.lisp

Dependency

regions/aab/consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).

Public Interface

3.1.41 rtg-math/vectors/base/docs.lisp

Dependency

regions/regions.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.42 rtg-math/vectors/vector2/docs-non-consing.lisp

Dependency

vectors/base/docs.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.43 rtg-math/vectors/vector2/docs-consing.lisp

Dependency

vectors/vector2/docs-non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.44 rtg-math/vectors/vector3/docs-non-consing.lisp

Dependency

vectors/vector2/docs-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.45 rtg-math/vectors/vector3/docs-consing.lisp

Dependency

vectors/vector3/docs-non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.46 rtg-math/vectors/vector4/docs-non-consing.lisp

Dependency

vectors/vector3/docs-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.47 rtg-math/vectors/vector4/docs-consing.lisp

Dependency

vectors/vector4/docs-non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.48 rtg-math/vectors/docs.lisp

Dependency

vectors/vector4/docs-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.49 rtg-math/matrices/base/docs.lisp

Dependency

vectors/docs.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.50 rtg-math/matrices/matrix2/docs-consing.lisp

Dependency

matrices/base/docs.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.51 rtg-math/matrices/matrix3/docs-consing.lisp

Dependency

matrices/matrix2/docs-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.52 rtg-math/matrices/matrix4/docs-consing.lisp

Dependency

matrices/matrix3/docs-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.53 rtg-math/matrices/matrix2/docs-non-consing.lisp

Dependency

matrices/matrix4/docs-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.54 rtg-math/matrices/matrix3/docs-non-consing.lisp

Dependency

matrices/matrix2/docs-non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.55 rtg-math/matrices/matrix4/docs-non-consing.lisp

Dependency

matrices/matrix3/docs-non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.56 rtg-math/matrices/docs.lisp

Dependency

matrices/matrix4/docs-non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.57 rtg-math/quaternions/docs-consing.lisp

Dependency

matrices/docs.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.58 rtg-math/quaternions/docs-non-consing.lisp

Dependency

quaternions/docs-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.59 rtg-math/polar-coords/docs.lisp

Dependency

quaternions/docs-non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.60 rtg-math/projection/orthographic/docs-non-consing.lisp

Dependency

polar-coords/docs.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.61 rtg-math/projection/orthographic/docs-consing.lisp

Dependency

projection/orthographic/docs-non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.62 rtg-math/projection/perspective/docs-non-consing.lisp

Dependency

projection/orthographic/docs-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.63 rtg-math/projection/perspective/docs-consing.lisp

Dependency

projection/perspective/docs-non-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.64 rtg-math/types-docs.lisp

Dependency

projection/perspective/docs-consing.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


3.1.65 rtg-math/docs.lisp

Dependency

types-docs.lisp (file).

Source

rtg-math.asd.

Parent Component

rtg-math (system).


4 Packages

Packages are listed by definition order.


4.1 rtg-math.projection.non-consing

Source

package.lisp.

Use List
Public Interface

4.2 rtg-math.vector4

Source

package.lisp.

Nickname

v4

Use List
Public Interface
Internals

4.3 rtg-math.region

Source

package.lisp.

Nickname

regions

Use List
Public Interface

4.4 rtg-math.matrix4.non-consing

Source

package.lisp.

Nickname

m4-n

Use List
Public Interface
Internals

4.5 rtg-math.base-matrices

Source

package.lisp.

Use List
Used By List

rtg-math.

Public Interface
  • m! (compiler macro).
  • m! (function).
Internals

m!one-arg (function).


4.6 rtg-math.spherical

Source

package.lisp.

Use List
Public Interface
Internals

unit-spherical->unit-cartesian (function).


4.7 rtg-math.types

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

4.8 rtg-math.vector2

Source

package.lisp.

Nickname

v2

Use List
Public Interface
Internals

4.9 rtg-math.matrix3

Source

package.lisp.

Nickname

m3

Use List
Public Interface
Internals

%* (function).


4.10 rtg-math.vector2.non-consing

Source

package.lisp.

Nickname

v2-n

Use List
Public Interface
  • * (compiler macro).
  • * (function).
  • *s (function).
  • + (compiler macro).
  • + (function).
  • +s (function).
  • - (compiler macro).
  • - (function).
  • -s (function).
  • / (function).
  • /s (function).
  • negate (function).
  • normalize (function).
  • rotate (function).
  • set-components (function).
Internals

4.11 rtg-math.quaternions

Source

package.lisp.

Nickname

q

Use List
Public Interface
Internals

4.12 rtg-math.base-vectors

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

4.13 rtg-math.vectors

Source

package.lisp.

Nickname

v

Use List
Public Interface
Internals

4.14 rtg-math.matrix2.non-consing

Source

package.lisp.

Nickname

m2-n

Use List
Public Interface
Internals

4.15 %rtg-math.matrix3.common

Source

package.lisp.

Use List
Used By List
Public Interface

4.16 rtg-math.region.axis-aligned-box

Source

package.lisp.

Nickname

aab

Use List
Public Interface

4.17 rtg-math.polar

Source

package.lisp.

Use List
Public Interface

4.18 rtg-math.region.ray3

Source

package.lisp.

Nickname

ray3

Use List
Public Interface

4.20 rtg-math.matrix4

Source

package.lisp.

Nickname

m4

Use List
Public Interface
Internals

4.21 %rtg-math.matrix4.common

Source

package.lisp.

Use List
Used By List
Public Interface

4.22 rtg-math.base-maths

Source

package.lisp.

Use List
Used By List
Public Interface
Internals

4.23 rtg-math.region.line3

Source

package.lisp.

Nickname

line3

Use List
Public Interface
Internals
  • /= (function).
  • = (function).

4.24 rtg-math.projection

Source

package.lisp.

Use List
Public Interface

4.25 rtg-math.quaternions.non-consing

Source

package.lisp.

Nickname

q-n

Use List
Public Interface
Internals

4.26 rtg-math

Source

package.lisp.

Use List

4.27 rtg-math.matrices

Source

package.lisp.

Nickname

m

Use List
Public Interface
Internals

melm (function).


4.28 %rtg-math.matrix2.common

Source

package.lisp.

Use List
Used By List
Public Interface

4.29 rtg-math.region.axis-aligned-box.non-consing

Source

package.lisp.

Nickname

aab-n

Use List
Public Interface

merge-point (function).


4.30 %rtg-math.quaternion.common

Source

package.lisp.

Use List
Used By List
Public Interface

4.31 rtg-math.vector4.non-consing

Source

package.lisp.

Nickname

v4-n

Use List
Public Interface
  • * (compiler macro).
  • * (function).
  • *s (function).
  • + (compiler macro).
  • + (function).
  • +s (function).
  • - (compiler macro).
  • - (function).
  • -s (function).
  • / (function).
  • /s (function).
  • negate (function).
  • normalize (function).
  • set-components (function).
Internals

4.32 rtg-math.matrix2

Source

package.lisp.

Nickname

m2

Use List
Public Interface
Internals

%* (function).


4.33 rtg-math.region.line-segment3

Source

package.lisp.

Nickname

line-seg3

Use List
Public Interface
Internals

4.34 %rtg-math.regions.axis-aligned-box.common

Source

package.lisp.

Use List
Public Interface

with-aab (macro).


4.35 rtg-math.matrix3.non-consing

Source

package.lisp.

Nickname

m3-n

Use List
Public Interface
Internals

4.36 rtg-math.vector3

Source

package.lisp.

Nickname

v3

Use List
Public Interface
Internals

4.37 rtg-math.vector3.non-consing

Source

package.lisp.

Nickname

v3-n

Use List
Public Interface
  • * (compiler macro).
  • * (function).
  • *s (function).
  • + (compiler macro).
  • + (function).
  • +s (function).
  • - (compiler macro).
  • - (function).
  • -s (function).
  • / (function).
  • /s (function).
  • negate (function).
  • normalize (function).
  • rotate (function).
  • set-components (function).
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Constants

Constant: +inv-pi+

‘(/ 1 pi)‘ as a ‘single-float‘. This is the older naming, it is now prefered to use ‘inv-pi-f‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: +one-degree-in-radians+

The number of degrees in 1 radian as a ‘single-float‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: +pi+

‘pi‘ as a ‘single-float‘. This is the older naming, it is now prefered to use ‘pi-f‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: 0.5pi

‘(/ pi 2)‘ as a ‘double-float‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: 0.5pi-f

‘(/ pi 2)‘ as a ‘single-float‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: 2pi

‘(* PI 2)‘ as a ‘double-float‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: 2pi-f

‘(* PI 2)‘ as a ‘single-float‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: inv-pi

‘(/ 1 pi) as a ‘double-float‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: inv-pi-f

‘(/ 1 pi) as a ‘single-float‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: pi-f

‘pi‘ as a ‘single-float‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.


5.1.2 Macros

Macro: case= (form &body cases)
Package

%rtg-math.

Source

utils.lisp.

Macro: decf (place &optional delta)

Decrements the ‘vec4‘ in ’place’ by another ‘vec4‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Macro: decf (place &optional delta)

Decrements the ‘vec2‘ in ’place’ by another ‘vec2‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Macro: decf (place &optional delta)

Decrements the vector in ’place’ by another vector of the same kind

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Macro: decf (place &optional delta)

Decrements the ‘vec3‘ in ’place’ by another ‘vec3‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Macro: defn (name typed-args result-types &body body)

Define a typed function

Package

%rtg-math.

Source

utils.lisp.

Macro: defn-inlinable (name typed-args result-types &body body)

Define a typed function that can be inlined but by default shouldn’t be

Package

%rtg-math.

Source

utils.lisp.

Macro: defn-inline (name typed-args result-types &body body)

Define a typed function and request that it be inlined

Package

%rtg-math.

Source

utils.lisp.

Macro: ecase= (form &body cases)
Package

%rtg-math.

Source

utils.lisp.

Macro: incf (place &optional delta)

Increments the ‘vec4‘ in ’place’ by another ‘vec4‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Macro: incf (place &optional delta)

Increments the ‘vec2‘ in ’place’ by another ‘vec2‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Macro: incf (place &optional delta)

Increments the vector in ’place’ by another vector of the same kind

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Macro: incf (place &optional delta)

Increments the ‘vec3‘ in ’place’ by another ‘vec3‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Macro: with-aab ((mina maxa) aab &body body)
Package

%rtg-math.regions.axis-aligned-box.common.

Source

regions/aab/common.lisp.


5.1.3 Compiler macros

Compiler Macro: * (&rest vec4s)
Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Compiler Macro: * (accum-mat &rest mat4s)
Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Compiler Macro: * (&rest vec2s)
Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Compiler Macro: * (&rest matrices)
Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Compiler Macro: * (accum-vec &rest vec2s)
Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Compiler Macro: * (accum-mat &rest mat4s)
Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Compiler Macro: * (&rest matrices)
Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Compiler Macro: * (accum-vec &rest vec4s)
Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Compiler Macro: * (&rest matrices)
Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Compiler Macro: * (accum-mat &rest mat4s)
Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Compiler Macro: * (&rest vec3s)
Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Compiler Macro: * (accum-vec &rest vec3s)
Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Compiler Macro: + (&rest vec4s)
Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Compiler Macro: + (&rest vec2s)
Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Compiler Macro: + (accum-vec &rest vec2s)
Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Compiler Macro: + (&rest components)
Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Compiler Macro: + (accum-quat &rest quaternions)
Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Compiler Macro: + (accum-vec &rest vec4s)
Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Compiler Macro: + (&rest vec3s)
Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Compiler Macro: + (accum-vec &rest vec3s)
Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Compiler Macro: - (&rest vec4s)
Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Compiler Macro: - (&rest vec2s)
Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Compiler Macro: - (accum-vec &rest vec2s)
Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Compiler Macro: - (&rest components)
Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Compiler Macro: - (accum-quat &rest quaternions)
Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Compiler Macro: - (accum-vec &rest vec4s)
Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Compiler Macro: - (&rest vec3s)
Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Compiler Macro: - (accum-vec &rest vec3s)
Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Compiler Macro: m! (&rest components)
Package

rtg-math.base-matrices.

Source

matrices/base/base-matrices.lisp.

Compiler Macro: melm (mat-a row col)

Provide access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix3.common.

Source

matrices/matrix3/common.lisp.

Compiler Macro: melm (mat-a row col)

Provide access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix4.common.

Source

matrices/matrix4/common.lisp.

Compiler Macro: melm (mat-a row col)

Provide access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix2.common.

Source

matrices/matrix2/common.lisp.

Compiler Macro: swizzle (vec pattern)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Compiler Macro: (setf swizzle) (vec pattern)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Compiler Macro: s~ (vec pattern)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Compiler Macro: (setf s~) (vec pattern)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Compiler Macro: v! (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: v!bool (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: v!byte (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: v!double (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: v!int (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: v!int8 (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: v!ubyte (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: v!uint (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: v!uint8 (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: w (vec)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: (setf w) (vec)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: x (vec)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: (setf x) (vec)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: y (vec)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: (setf y) (vec)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: z (vec)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: (setf z) (vec)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.


5.1.4 Ordinary functions

Function: * (&rest vec4s)

Takes any number of ‘vec4‘ and performs component-wise multiplication on them returning a new ‘vec4‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: * (accum-mat &rest mat4s)

Takes any number of ‘mat4‘s and multiplies them together destructively writing the result into the first ‘mat4‘.

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: * (&rest vec2s)

Takes any number of ‘vec2‘ and performs component-wise multiplication on them returning a new ‘vec2‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: * (&rest matrices)

Takes any number of ‘mat3‘s and multiplies them together returning a new ‘mat3‘.

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: * (accum-vec &rest vec2s)

Destructively performs component-wise multiplication of the ‘vec2‘s, the first ‘vec2‘ is mutated.

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: * (quat-a quat-b)

Multiplies (and thus combines) the two ‘quaternion‘s given, returning a new ‘quaternion‘

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: * (vec-a scalar-or-vec)

Adds two vectors together and returns the result as a new vector of the same type

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: * (accum-mat &rest mat2s)

Takes any number of ‘mat2‘s and multiplies them together destructively writing the result into the first ‘mat2‘.

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: * (&rest matrices)

Takes any number of ‘mat4‘s and multiplies them together returning a new ‘mat4‘.

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: * (quat-to-mutate quat-b)

Destructively multiplies (and thus combines) the second ‘quaternion‘ into the first.

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: * (matrix-a mat-vec-or-scalar)

Takes any number of matrices (of the same kind) and multiplies them together returning a new matrix of the same kind.

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: * (accum-vec &rest vec4s)

Destructively performs component-wise multiplication of the ‘vec4‘s, the first ‘vec4‘ is mutated.

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: * (&rest matrices)

Takes any number of ‘mat2‘s and multiplies them together returning a new ‘mat2‘.

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: * (accum-mat &rest mat3s)

Takes any number of ‘mat3‘s and multiplies them together destructively writing the result into the first ‘mat3‘.

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: * (&rest vec3s)

Takes any number of ‘vec3‘ and performs component-wise multiplication on them returning a new ‘vec3‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: * (accum-vec &rest vec3s)

Destructively performs component-wise multiplication of the ‘vec3‘s, the first ‘vec3‘ is mutated.

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: *s (vector-a a)

Component-wise multiplication of the vector by the scalar

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: *s (mat-to-mutate scalar)

Destructively performs component-wise multiplication of the ‘vec3‘ by the scalar

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: *s (vector-a a)

Component-wise multiplication of the vector by the scalar

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: *s (mat-a scalar)

Multiplies the components of the ‘mat3‘ by the scalar provided

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: *s (vec2 a)

Destructively performs component-wise multiplication of the ‘vec2‘ by the scalar

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: *s (quat-a scalar)

Component-wise multiplication of the ‘quaternion‘ by the scalar

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: *s (mat-to-mutate scalar)
Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: *s (mat-a scalar)

Multiplies the components of the ‘mat4‘ by the scalar provided

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: *s (vec4 a)

Destructively performs component-wise multiplication of the ‘vec4‘ by the scalar

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: *s (mat-a scalar)

Multiplies the components of the ‘mat2‘ by the scalar provided

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: *s (mat-to-mutate scalar)

Multiplies the components of the ‘mat4‘ by the scalar provided

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: *s (vector-a a)

Component-wise multiplication of the vector by the scalar

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: *s (vec3 a)

Destructively performs component-wise multiplication of the ‘vec3‘ by the scalar

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: *v (mat-a vec4-to-mutate)

Destructively multiplies the ‘vec3‘ by the top left 3x3 portion of the ‘mat4‘ returning the mutated ‘vec3‘

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: *v (mat-a vec-a)

Multiplies the ‘vec3‘ by the ‘mat3‘ and returns the result as a new ‘vec3‘

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: *v (mat-a vec2-to-mutate)

Destructively multiplies the ‘vec3‘ by the ‘mat2‘ and returning the mutated ‘vec3‘

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: *v (mat-a vec4)

Multiplies the ‘vec4‘ by the ‘mat4‘ and returns the result as a new ‘vec4‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: *v (mat-a vec-a)

Multiplies the ‘vec2‘ by the ‘mat2‘ and returns the result as a new ‘vec2‘

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: *v (mat-a vec3-to-mutate)

Destructively multiplies the ‘vec3‘ by the ‘mat3‘ and returning the mutated ‘vec3‘

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: *v3 (mat-a vec3-to-mutate)
Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: *v3 (mat-a vec3)

Multiplies the ‘vec3‘ by the ‘mat3‘ and returns the result as a new ‘vec3‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: + (&rest vec4s)

Takes any number of ‘vec4‘ and performs component-wise addition on them returning a new ‘vec4‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: + (mat-accum mat-b)

Add the second ‘mat4‘ component wise to the first and return the first

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: + (&rest vec2s)

Takes any number of ‘vec2‘ and performs component-wise addition on them returning a new ‘vec2‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: + (mat-a mat-b)

Adds the 2 matrices component wise and returns the result as a new ‘mat3‘

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: + (accum-vec &rest vec2s)

Destructively performs component-wise addition of the ‘vec2‘s, the first ‘vec2‘ is mutated.

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: + (&rest quats)

Component-wise addition of any number of quaternions.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: + (&rest vecs)

Adds ’n’ ‘vec2‘, ‘vec3‘ or ‘vec4‘ together, returning a new vector of the same kind.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: + (mat-accum mat-b)

Add the second ‘mat2‘ component wise to the first and return the first

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: + (mat-a mat-b)

Adds the 2 matrices component wise and returns the result as a new ‘mat4‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: + (accum-quat &rest quaternions)

Destructively performs component-wise addition of the ‘quaternion‘s, the first ‘quaternion‘ is mutated.

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: + (&rest matrices)

Takes any number of matrices (of the same kind) and performs component-wise addition them together returning a new matrix of the same kind.

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: + (accum-vec &rest vec4s)

Destructively performs component-wise addition of the ‘vec4‘s, the first ‘vec4‘ is mutated.

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: + (mat-a mat-b)

Adds the 2 matrices component wise and returns the result as a new ‘mat2‘

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: + (mat-accum mat-b)

Add the second ‘mat3‘ component wise to the first and return the first

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: + (&rest vec3s)

Takes any number of ‘vec3‘ and performs component-wise addition on them returning a new ‘vec3‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: + (accum-vec &rest vec3s)

Destructively performs component-wise addition of the ‘vec3‘s, the first ‘vec3‘ is mutated.

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: +s (vec4 scalar)

Component-wise add of single-float to ‘vec4‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: +s (vec2 scalar)

Component-wise add of single-float to ‘vec2‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: +s (vec2 scalar)

Destructive Component-wise add of ‘single-float‘ into the given ‘vec2‘

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: +s (vec scalar)

Componentwise addition of the given scalar to the components of the ‘vec2‘, ‘vec3‘ or ‘vec4‘ provided. Returns a new vector of the same kind.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: +s (vec4 scalar)

Destructive Component-wise add of ‘single-float‘ into the given ‘vec2‘

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: +s (vec3 scalar)

Component-wise add of single-float to ‘vec3‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: +s (vec3 scalar)

Destructive Component-wise add of ‘single-float‘ into the given ‘vec3‘

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: - (vec4 &rest vec4s)

Takes any number of ‘vec4‘ and performs component-wise subtraction on them returning a new ‘vec4‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: - (mat-accum mat-b)

Subtracts the second ‘mat4‘ component wise from the first and return the first

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: - (vec2 &rest vec2s)

Takes any number of ‘vec2‘ and performs component-wise subtraction on them returning a new ‘vec2‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: - (mat-a mat-b)

Subtracts the 2 matrices component wise and returns the result as a new ‘mat3‘

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: - (accum-vec &rest vec2s)

Destructively performs component-wise substraction of the ‘vec2‘s, the first ‘vec2‘ is mutated.

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: - (quat &rest quats)

Takes any number of ‘quaternion‘ and performs component-wise subtraction on them returning a new ‘quaternion‘

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: - (&rest vecs)

Subtracts ’n’ ‘vec2‘, ‘vec3‘ or ‘vec4‘ from each other, returning a new vector of the same kind.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: - (mat-accum mat-b)

Subtracts the second ‘mat2‘ component wise from the first and return the first

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: - (mat-a mat-b)

Subtracts the 2 matrices component wise and returns the result as a new ‘mat4‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: - (accum-quat &rest quaternions)

Destructively performs component-wise substraction of the ‘quaternion‘s, the first ‘quaternion‘ is mutated.

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: - (&rest matrices)

Takes any number of matrices (of the same kind) and performs component-wise negation of them returning a new matrix of the same kind.

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: - (accum-vec &rest vec4s)

Destructively performs component-wise substraction of the ‘vec4‘s, the first ‘vec4‘ is mutated.

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: - (mat-a mat-b)

Subtracts the 2 matrices component wise and returns the result as a new ‘mat2‘

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: - (mat-accum mat-b)

Subtracts the second ‘mat3‘ component wise from the first and return the first

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: - (vec3 &rest vec3s)

Takes any number of ‘vec3‘ and performs component-wise subtraction on them returning a new ‘vec3‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: - (accum-vec &rest vec3s)

Destructively performs component-wise substraction of the ‘vec3‘s, the first ‘vec3‘ is mutated.

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: -s (vec4 scalar)

Component-wise subtraction of single-float from ‘vec4‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: -s (vec2 scalar)

Component-wise subtraction of single-float from ‘vec2‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: -s (vec2 scalar)

Destructive Component-wise subtraction of ‘single-float‘ from the given ‘vec2‘

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: -s (vec scalar)

Componentwise subtractiong of the given scalar from the components of the ‘vec2‘, ‘vec3‘ or ‘vec4‘ provided. Returns a new vector of the same kind.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: -s (vec4 scalar)

Destructive Component-wise subtraction of ‘single-float‘ from the given ‘vec2‘

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: -s (vec3 scalar)

Component-wise subtraction of single-float from ‘vec3‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: -s (vec3 scalar)

Destructive Component-wise subtraction of ‘single-float‘ from the given ‘vec3‘

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: / (vector-a vector-b)

Component-wise division of the two ‘vec4‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: / (vector-a vector-b)

Component-wise division of the two ‘vec2‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: / (vec2-a vec2-b)

Destructively performs component-wise division of the ‘vec2‘s, the first ‘vec2‘ is mutated

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: / (vec-a scalar-or-vec)

Divides the given ‘vec2‘, ‘vec3‘ or ‘vec4‘ by the scalar or vector provided.

If a vector is provided it must be of the same kind as ‘vec-a‘ and the division is performed component-wise.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: / (vec4-a vec4-b)

Destructively performs component-wise division of the ‘vec4‘s, the first ‘vec4‘ is mutated

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: / (vector-a vector-b)

Component-wise division of the two ‘vec3‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: / (vec3-a vec3-b)

Destructively performs component-wise division of the ‘vec3‘s, the first ‘vec3‘ is mutated

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: /= (q1 q2)

Component-wise comparison of two quaternions. Returns T if any components are not equal (by =)

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: /= (&rest vecs)

Returns either t if the two vectors are equal. Otherwise it returns nil.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: /= (aab-0 aab-1)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: /= (ray3-a ray3-b)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: /= (&rest matrices)

Returns either t if the matrices are equal. Otherwise it returns nil.

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: /= (line-seg3-a line-seg3-b)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: /s (vector-a a)

Component-wise division of the vector by the scalar

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: /s (vector-a a)

Component-wise division of the vector by the scalar

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: /s (vec2 a)

Destructively performs component-wise division of the ‘vec2‘ by the scalar

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: /s (vec4 a)

Destructively performs component-wise division of the ‘vec4‘ by the scalar

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: /s (vector-a a)

Component-wise division of the vector by the scalar

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: /s (vec3 a)

Destructively performs component-wise division of the ‘vec3‘ by the scalar

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: 0! ()
Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: 0! ()

Returns a new ‘quaternion‘ where every component is 0

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: 0! ()

Return a ‘mat4‘ where every component is 0

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: 0! ()

Return a ‘mat2‘ where all components are zero

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: 0p (vector-a)

Checks if the length of the vector is zero. As this is a
floating point number it checks to see if the length is
below a threshold set in the base-maths package

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: 0p (vector-a)

Checks if the length of the vector is zero. As this is a floating point number it checks to see if the length is below a threshold set in the base-maths package

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: 0p (mat-a)

Returns T if this is a zero matrix

As contents of the matrix are floats the values have an error bound as defined in base-maths

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: 0p (quat)

Returns T if all the components of the given ‘quaternion‘ are 0

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: 0p (vec-a)

Returns t if the vector is of zero length

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: 0p (mat-a)

Returns T if this is a zero matrix

As contents of the matrix are floats the values have an error bound as defined in base-maths

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: 0p (matrix)

Returns T if all the components of the matrix ‘=‘ 0

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: 0p (mat-a)

Returns T if this is a zero matrix

As contents of the matrix are floats the values have an error bound as defined in base-maths

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: 0p (vector-a)

Checks if the length of the vector is zero. As this is a
floating point number it checks to see if the length is
below a threshold set in the base-maths package

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: 1+ (matrix-a matrix-b)

Returns a new matrix which is equal to the given matrix with every component incremented by 1

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: 1- (matrix-a matrix-b)

Returns a new matrix which is equal to the given matrix with every component decremented by 1

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: = (vector-a vector-b)

Returns either t if the two vectors are equal. Otherwise it returns nil.

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: = (vector-a vector-b)

Returns T if the two vectors are equal. Otherwise it returns nil.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: = (mat-a mat-b)

Returns T if all elements of both matrices provided are equal

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: = (q1 q2)

Returns T if the two ‘quaternion‘s given are component-wise equal (by cl:=)

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: = (&rest vecs)

Returns either t if the vectors are equal. Otherwise it returns nil.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: = (aab-0 aab-1)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: = (ray3-a ray3-b)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: = (mat-a mat-b)

Returns T if all elements of both matrices provided are equal

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: = (&rest matrices)

Returns either t if the matrices are equal. Otherwise it returns nil.

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: = (mat-a mat-b)

Returns T if all elements of both matrices provided are equal

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: = (line-seg3-a line-seg3-b)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: = (vector-a vector-b)

Returns either t if the two vectors are equal. Otherwise it returns nil.

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: abs (vector-a)

Return a ‘vec4‘ containing the ‘abs‘ of the original vec4’s components.

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: abs (vector-a)

Return a ‘vec2‘ containing the ‘abs‘ of the original vec2’s components.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: abs (vector-a)

Return a ‘vec3‘ containing the ‘abs‘ of the original vec3’s components.

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: absolute-dot (vector-a vector-b)

Return the absolute dot product of the vector-a and vector-b.

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: absolute-dot (vector-a vector-b)

Return the absolute dot product of the vector-a and vector-b.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: absolute-dot (vec-a vec-b)

Adds two vectors together and returns the result as a new vector of the same type

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: absolute-dot (vector-a vector-b)

Return the absolute dot product of the vector-a and vector-b.

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: add-point (aab point-v3)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: adjoint (mat-to-mutate)

Mutates the given ‘mat4‘ to be it’s own adjoint

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: adjoint (mat-a)

Returns the adjoint of the provided matrix

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: adjoint (mat-to-mutate)

Mutates the given ‘mat2‘ to be it’s own adjoint

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: adjoint (mat-a)

Returns the adjoint of the provided matrix

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: adjoint (mat-a)

Returns the adjoint of the provided matrix

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: adjoint (mat-to-mutate)

Mutates the given ‘mat3‘ to be it’s own adjoint

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: affine-inverse (mat-to-invert)

Mutates the given ‘mat4‘ to be it’s own inverse

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: affine-inverse (mat-a)

returns the inverse of the ‘mat3‘

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: affine-inverse (mat-a)

returns the inverse of the ‘mat4‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: affine-inverse (matrix-a)

Returns a new matrix which is the inverse of the one given.

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: affine-inverse (mat-to-invert)

Mutates the given ‘mat3‘ to be it’s own inverse

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: angle-between (vec-a vec-b)

Returns the angle between two ‘vec2‘s.

Equivilent to (abs (v2:angle-from a b))

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: angle-from (vec-from vec-to)

Returns the signed angle between the two ‘vec2‘s.

Positive angles are counter-clockwise

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: approx-slerp (start-quat end-quat pos)

A faster and less accurate version of ‘slerp‘ for quaternions

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: bezier (a1 a2 b1 b2 ammount)

{TODO}

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: bezier (a1 a2 b1 b2 ammount)

{TODO}

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: bezier (a1 a2 b1 b2 ammount)

{TODO}

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: bezier (a1 a2 b1 b2 ammount)

{TODO}

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: cartesian->polar (vec2)

Takes a polar coord vector with the layout (θ r) and and converts it to a cartesian ‘vec2‘

Notes:
r - length of υ
θ - angle between υ and y axis
θ>0 means counter-clockwise rotation

Package

rtg-math.polar.

Source

polar-coords/polar.lisp.

Function: cartesian->spherical (vec3)

Takes a cartesian vector3 and converts it to a spherical coord vector with the layout (θ φ ρ).

Notes:
θ - angle between υ and x axis (rotating around z) φ - angle between υ and z axis
ρ - distance from origin (lengh of υ)

Package

rtg-math.spherical.

Source

spherical-coords/spherical.lisp.

Function: closest-line-points (line3-a line3-b)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: closest-line-points (line-seg3 line3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: closest-line-segment-points (line-seg-a line-seg-b)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: closest-point (ray3 point-v3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: closest-point (line3 point-v3)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: closest-point (line-seg3 point-v3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: closest-ray-points (ray3-a ray3-b)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: closest-ray-points (line-seg-a ray3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: conjugate (quat)

Returns the conjugate of the given quaternion

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: conjugate (quat-to-mutate)

Destructively replaces the given ‘quaternion‘ with it’s conjugate

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: copy (quat)

Returns a fresh ‘quaternion‘ which is = to the one given

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: copy-mat2 (mat2)

Returns a fresh ‘mat2‘ which is m2:= to the orignal matrix

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: copy-mat3 (mat3)

Returns a fresh ‘mat3‘ which is m3:= to the orignal matrix

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: copy-mat4 (mat4)

Returns a fresh ‘mat4‘ which is m4:= to the orignal matrix

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: copy-vec2 (vec2)

Returns a fresh ‘vec2‘ which is v2:= to the orignal vector

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: copy-vec3 (vec3)

Returns a fresh ‘vec3‘ which is v3:= to the orignal vector

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: copy-vec4 (vec4)

Returns a fresh ‘vec4‘ which is v4:= to the orignal vector

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: cross (vec-a vec-b)

Calculates the cross-product of 2 ‘vec2‘s. This results in a ‘single-float‘ which is 2 times the area of the triangle.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: cross (vec-a vec-b)

Calculates the cross-product of 2 vectors, i.e. the vector that lies perpendicular to them both. The resulting vector will not be normalized.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: cross (vec-a vec-b)

Calculates the cross-product of 2 ‘vec3‘, i.e. the vector that lies perpendicular to them both. The resulting ‘vec3‘ will not be normalized.

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: degrees-f (radians)

Converts a quantity, specified in radians as a ‘single-float‘ into degrees.

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Function: determinant (mat-a)

Returns the determinant of the ‘mat3‘ (uses the cramer method)

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: determinant (mat-a)

Returns the determinant of the ‘mat4‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: determinant (matrix-a)

Returns the determinant of the given matrix

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: direction (ray3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: direction (line3)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: direction (line-seg3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: distance (vector-a vector-b)

Return the distance between 2 points defined by vectors
vector-a & vector-b. If comparing distances, use
c-distance-squared as it desnt require a sqrt and thus is
faster.
If simply comparing distances then prefer the ‘distance-squared‘ function as the ‘sqrt‘ required here is (relatively) slow.

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: distance (vector-a vector-b)

Return the distance between 2 points defined by vectors
vector-a & vector-b. If comparing distances, use
c-distance-squared as it desnt require a sqrt and thus is
faster.
If simply comparing distances then prefer the ‘distance-squared‘ function as the ‘sqrt‘ required here is (relatively) slow.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: distance (vec-a vec-b)

Return the distance between 2 points defined by vectors vector-a & vector-b. If comparing distances, use c-distance-squared as it desnt require a sqrt and thus is faster.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: distance (vector-a vector-b)

Return the distance between 2 points defined by vectors
vector-a & vector-b. If comparing distances, use
c-distance-squared as it desnt require a sqrt and thus is
faster.
If simply comparing distances then prefer the ‘distance-squared‘ function as the ‘sqrt‘ required here is (relatively) slow.

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: distance-squared (vector-a vector-b)

Finds the squared distance between 2 points defined by ‘vec4‘s vector-a & vector-b

‘distance‘ is the square root of this value. The ‘sqrt‘ function is (relatively) slow so if all thats needs doing is to compare distances then prefer the ‘distance-squared‘ function

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: distance-squared (vector-a vector-b)

Finds the squared distance between 2 points defined by ‘vec2‘s vector-a & vector-b

‘distance‘ is the square root of this value. The ‘sqrt‘ function is (relatively) slow so if all thats needs doing is to compare distances then prefer the ‘distance-squared‘ function

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: distance-squared (vec-a vec-b)

Returns the squared distance between 2 points defined by vectors vector-a & vector-b

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: distance-squared (vector-a vector-b)

Finds the squared distance between 2 points defined by ‘vec3‘s vector-a & vector-b

‘distance‘ is the square root of this value. The ‘sqrt‘ function is (relatively) slow so if all thats needs doing is to compare distances then prefer the ‘distance-squared‘ function

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: distance-squared-to-line-seg3 (line-seg-a line-seg-b)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: distance-squared-to-line3 (ray3 line3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: distance-squared-to-line3 (line3-a line3-b)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: distance-squared-to-line3 (line-seg3 line3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: distance-squared-to-point (ray3 point-v3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: distance-squared-to-point (line3 point-v3)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: distance-squared-to-point (line-seg3 point-v3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: distance-squared-to-ray3 (ray3-a ray3-b)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: distance-squared-to-ray3 (line-seg3 ray3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: distance-to-line-seg3 (line-seg-a line-seg-b)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: distance-to-line3 (ray3 line3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: distance-to-line3 (line3-a line3-b)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: distance-to-line3 (line-seg3 line3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: distance-to-point (ray3 point-v3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: distance-to-point (line3 point-v3)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: distance-to-point (line-seg3 point-v3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: distance-to-ray3 (ray3-a ray3-b)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: distance-to-ray3 (line-seg3 ray3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: dot (vector-a vector-b)

Return the dot product of vector-a and vector-b.

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: dot (vector-a vector-b)

Return the dot product of vector-a and vector-b.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: dot (vec-a vec-b)

Returns the dot product of the 2 given vectors.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: dot (quat-a quat-b)

return the dot product of the quat-a and quat-b.

Package

%rtg-math.quaternion.common.

Source

quaternions/common.lisp.

Function: dot (vector-a vector-b)

Return the dot product of vector-a and vector-b.

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: elm (matrix row col)

DEPRECATED: Please use melm

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: elt (matrix row col)

DEPRECATED: Please use melm

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: end-point0 (line-seg3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: end-point1 (line-seg3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: face-foreward (vector-a vector-b)

Returns ‘vector-a‘ if ‘(> (v4:dot vector-a vector-b) 0)‘ else returns ‘(v4:negate vector-a)‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: face-foreward (vector-a vector-b)

Returns ‘vector-a‘ if ‘(> (v2:dot vector-a vector-b) 0)‘ else returns ‘(v2:negate vector-a)‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: face-foreward (vec-a vec-b)

Returns ‘vector-a‘ if ‘(> (v3:dot vector-a vector-b) 0)‘ else returns ‘(v3:negate vector-a)‘

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: face-foreward (vector-a vector-b)

Returns ‘vector-a‘ if ‘(> (v3:dot vector-a vector-b) 0)‘ else returns ‘(v3:negate vector-a)‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: from-aabs (&rest aabs)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: from-angle (angle)

Makes a ‘vec2‘ from an angle in radians.

Angle is in radians turning counterclockwise from ‘(v! 0 1)‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: from-axies (x-axies y-axies z-axies)

{TODO}

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: from-axis-angle (axis-vec3 angle)

Returns a new ‘quaternion‘ which represents a rotation around the given axis by the given angle

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: from-axis-angle (quat-to-mutate axis-vec3 angle)

Turns the given ‘quaternion‘ into one which represents a rotation around the given axis by the given angle

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: from-columns (col-1 col-2 col-3)

Make a ‘mat3‘ using the data in the 3 ‘vec3‘s to populate the columns

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: from-columns (col-1 col-2 col-3 col-4)

Make a ‘mat4‘ using the data in the 4 ‘vec4‘s to populate the columns

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: from-columns (col-1 col-2)

Make a ‘mat2‘ using the data in the 2 ‘vec2‘s to populate the columns

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: from-columns-v3 (col-1 col-2 col-3)

Make a ‘mat4‘ using the data in the 3 ‘vec3‘s provided to populate the columns.

The 4th row & column are filled as an identity matrix would be.

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: from-complex (c)

Makes a ‘vec2‘ from a ‘complex‘. The ‘realpart‘ becomes the ‘x‘ component and the ‘imagpart‘ becomes the ‘y‘ component.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: from-direction (up3 dir3)

Creates a ‘mat3‘ that would rotate the vector (v! 0 0 -1) to point in the given direction.

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: from-direction (up3 dir3)

Creates a ‘quaternion‘ that would rotate the vector (v! 0 0 -1) to face in the given direction.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: from-direction (up3 dir3)

Creates a ‘mat4‘ that would rotate the vector (v! 0 0 -1) to face in the given direction.

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: from-fixed-angles (x-rot y-rot z-rot)

Creates a ‘quaternion‘ that represents a rotation around the given axies by the given angles

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: from-fixed-angles (quat-to-mutate x-rot y-rot z-rot)

Turns the given ‘quaternion‘ into one which represents a rotation around the given axies by the given angles.

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: from-fixed-angles-v3 (angles)

Creates a ‘quaternion‘ that represents a rotation around the given axies by the angles given in the ‘vec3‘

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: from-mat3 (mat3)

Creates ‘quaternion‘ that represents the same rotation the ‘mat3‘ does.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: from-mat3 (m-a)

Takes a ‘mat3‘ and returns a ‘mat4‘ rotation matrix with the same values.

The 4th row & column are filled as an identity matrix would be.

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: from-mat3 (quat-to-mutate mat3)

Destructively updates of the components of the given ‘quaternion‘ making it represent the rotation from the given ‘mat3‘.

Assumes that this is a rotation matrix. It is critical that this
is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: from-points (list-of-vec3)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: from-rows (row-1 row-2 row-3)

Make a ‘mat3‘ using the data in the 3 ‘vec3‘s to populate the rows

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: from-rows (row-1 row-2 row-3 row-4)

Make a ‘mat4‘ using the data in the 4 ‘vec4‘s to populate the rows

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: from-rows (row-1 row-2)

Make a ‘mat2‘ using the data in the 2 ‘vec2‘s to populate the rows

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: from-rows-v3 (row-1 row-2 row-3)

Make a ‘mat4‘ using the data in the 3 ‘vec3‘s provided to populate the rows.

The 4th row & column are filled as an identity matrix would be.

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: get-axis-angle (mat-a)

Gets one possible axis-angle pair that will generate this
‘mat3‘.

Assumes that this is a rotation matrix. It is critical that this
is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: get-axis-angle (quat)

Gets one possible axis-angle pair that will generate this ‘quaternion‘

Assumes that this is a normalized quaternion. It is critical that this is true as otherwise you will at best get a runtime error, and most likely a silently incorrect result.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: get-axis-angle (mat-a)

Gets one possible axis-angle pair that will generate this
‘mat4‘.

Assumes that this is a rotation matrix. It is critical that this
is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: get-column (mat-a col-num)

Return the specified column of the matrix as a ‘vec3‘

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: get-column (mat-a col-num)

Return the specified column of the matrix as a ‘vec4‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: get-column (matrix-a col-num)

Returns the specifed column of the matrix as vector

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: get-column (mat-a col-num)

Return the specified column of the matrix as a ‘vec2‘

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: get-columns (mat-a)

Return the columns of the matrix as 3 ‘vec3‘s

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: get-columns (mat-a)

Return the columns of the matrix as 4 ‘vec4‘s

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: get-columns (matrix-a)

Returns the columns of the matrix as a list of vectors

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: get-columns (mat-a)

Return the columns of the matrix as 2 ‘vec2‘s

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: get-fixed-angles (mat-a)

Gets one set of possible z-y-x fixed angles that will generate
this ‘mat3‘.

Assumes that this is a rotation matrix. It is critical that this
is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: get-fixed-angles (mat-a)

Gets one set of possible z-y-x fixed angles that will generate
this ‘mat4‘.

Assumes that this is a rotation matrix. It is critical that this
is true (and elements are between -1f0 and 1f0) as otherwise you will at best get a runtime error, and most likely a silently incorrect result.

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: get-row (mat-a row-num)

Return the specified row of the matrix as a ‘vec3‘

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: get-row (mat-a row-num)

Return the specified row of the matrix as a ‘vec4‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: get-row (matrix-a row-num)

Returns the specifed row of the matrix as vector

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: get-row (mat-a row-num)

Return the specified row of the matrix as a ‘vec2‘

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: get-rows (mat-a)

Return the rows of the matrix as 3 ‘vec3‘s

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: get-rows (mat-a)

Return the rows of the matrix as 4 ‘vec4‘s

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: get-rows (matrix-a)

Returns the rows of the matrix as a list of vectors

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: get-rows (mat-a)

Return the rows of the matrix as 2 ‘vec2‘s

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: identity ()

Return a ‘mat3‘ identity matrix

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: identity ()

Returns a fresh identity quaternion

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: identity ()

Return a ‘mat4‘ identity matrix

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: identity ()

Return a ‘mat2‘ identity matrix

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: identity-p (quat)

Returns T if the given ‘quaternion‘ is the identity quaternion

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: identityp (mat-a)

Returns T if this is an identity matrix

As contents of the matrix are floats the values have an error bound as defined in base-maths

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: identityp (mat-a)

Returns T if this is an identity matrix

As contents of the matrix are floats the values have an error bound as defined in base-maths

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: identityp (mat-a)

Returns T if this is an identity matrix

As contents of the matrix are floats the values have an error bound as defined in base-maths

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: intersects-p (aab-0 aab-1)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: intersects-with-line-segment-p (aab line-seg3)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: intersects-with-line3-p (aab line3)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: intersects-with-ray3-p (aab ray3)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: inv-sqrt (x)

Calculates the inverse square root of a number

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Function: inverse (quat)

Returns a new ‘quaternion‘ that is the inverse of the one given

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: inverse (matrix)

Inverts the matrix.

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: inverse (matrix-a)

Returns the inverse of the given matrix

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: length (vector-a)

Returns the length of the ‘vec4‘

If you only need to compare relative lengths then prefer the ‘length-squared‘ function as ‘sqrt‘ is a (relatively) slow operation.

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: length (vector-a)

Returns the length of the ‘vec2‘

If you only need to compare relative lengths then prefer the ‘length-squared‘ function as ‘sqrt‘ is a (relatively) slow operation.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: length (vec-a)

Returns the length of a vector
If you only need to compare relative lengths then definately stick to length-squared as the sqrt is a slow operation.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: length (line-seg3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: length (vector-a)

Returns the length of the ‘vec3‘

If you only need to compare relative lengths then prefer the ‘length-squared‘ function as ‘sqrt‘ is a (relatively) slow operation.

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: length-squared (vector-a)

Return the squared length of the ‘vec4‘

‘length‘ is the square root of this value. The ‘sqrt‘ function is (relatively slow so if all thats needs doing is to compare lengths then prefer the ‘length-squared‘ function

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: length-squared (vector-a)

Return the squared length of the ‘vec2‘

‘length‘ is the square root of this value. The ‘sqrt‘ function is (relatively slow so if all thats needs doing is to compare lengths then prefer the ‘length-squared‘ function

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: length-squared (vec-a)

Finds the squared distance between 2 points defined by vectors vector-a & vector-b

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: length-squared (line-seg3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: length-squared (vector-a)

Return the squared length of the ‘vec3‘

‘length‘ is the square root of this value. The ‘sqrt‘ function is (relatively slow so if all thats needs doing is to compare lengths then prefer the ‘length-squared‘ function

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: lerp (vector-a vector-b ammount)

Linearly interpolates between the two ‘vec4‘s by the ‘single-float‘ amount

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: lerp (vector-a vector-b ammount)

Linearly interpolates between the two ‘vec2‘s by the ‘single-float‘ amount

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: lerp (start-quat end-quat pos)

Linearaly interpolate between two quaternions. Note that this will always take the shortest path.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: lerp (vector-a vector-b ammount)

Linearly interpolates between the two vectors by the given amount. Returns a new vector of the same kind.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: lerp (start end amount)

Performs a linear interpolation between ’start’ and ’end’ by the given ‘amount‘

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Function: lerp (vector-a vector-b ammount)

Linearly interpolates between the two ‘vec3‘s by the ‘single-float‘ amount

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: look-at (up3 from3 to3)

Creates a ‘mat3‘ that would rotate the vector (v! 0 0 -1) to point in the direction from ‘from3‘ to ‘to3‘

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: look-at (up3 from3 to3)

Creates a ‘quaternion‘ that would rotate the vector (v! 0 0 -1) to point in the direction from ‘from3‘ to ‘to3‘

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: look-at (up3 from3 to3)

Creates a ‘mat4‘ that would rotate the vector (v! 0 0 -1) to point in the direction from ‘from3‘ to ‘to3‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: m! (&rest components)

Creates a new ‘mat2‘, ‘mat3‘ or ‘mat4‘ based on the number of components provided.

Package

rtg-math.base-matrices.

Source

matrices/base/base-matrices.lisp.

Function: magnitude (quat)

Returns the magnitude of the quaternion

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: make (x y z w)

Make a ‘vec4‘ from 4 ‘single-float‘s

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: make (x y)

This takes 2 single-floats and give back a ‘vec2‘.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: make (a b c d e f g h i)

Make a ‘mat3‘. Data must be provided in row major order

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: make (w x y z)

Make a ‘quaternion‘ from 4 ‘single-float‘s

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: make (minima maxima)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: make (origin-v3 direction-v3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: make (a b c d e f g h i j k l m n o p)

Make a ‘mat4‘. Data must be provided in row major order

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: make (origin-v3 direction-v3)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: make (a b c d)

Make a ‘mat2‘. Data must be provided in row major order

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: make (end-point0 end-point1)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: make (x y z)

Make a ‘vec3‘ from 3 ‘single-float‘s

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: make-from-point-offset (point-v3 offset-v3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: maxima (aab)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: melm (mat-a row col)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix3.common.

Source

matrices/matrix3/common.lisp.

Function: (setf melm) (mat-a row col)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix3.common.

Source

matrices/matrix3/common.lisp.

Function: melm (mat-a row col)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix4.common.

Source

matrices/matrix4/common.lisp.

Function: (setf melm) (mat-a row col)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix4.common.

Source

matrices/matrix4/common.lisp.

Function: melm (mat-a row col)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix2.common.

Source

matrices/matrix2/common.lisp.

Function: (setf melm) (mat-a row col)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix2.common.

Source

matrices/matrix2/common.lisp.

Function: merge-into-vector (&rest vectors)

Takes a list of vectors and combines them into a new vector

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: merge-point (aab point-v3)
Package

rtg-math.region.axis-aligned-box.non-consing.

Source

regions/aab/non-consing.lisp.

Function: minima (aab)
Package

rtg-math.region.axis-aligned-box.

Source

regions/aab/consing.lisp.

Function: minor (mat-a row-0 row-1 row-2 col-0 col-1 col-2)

Returns the minor of the matrix

Package

%rtg-math.matrix4.common.

Source

matrices/matrix4/common.lisp.

Function: mix (vector-a vector-b ammount)

Linearly interpolates between the two vectors by the given amount. Returns a new vector of the same kind.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: mref (mat-a col row)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix3.common.

Source

matrices/matrix3/common.lisp.

Function: (setf mref) (mat-a col row)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix3.common.

Source

matrices/matrix3/common.lisp.

Function: mref (mat-a col row)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix4.common.

Source

matrices/matrix4/common.lisp.

Function: (setf mref) (mat-a col row)

Provides access to data in the matrix by row
and column number. The actual data is stored in a 1d list in column major order, but this abstraction means we only have to think in row major order which is how most mathematical texts and online tutorials choose to show matrices

Package

%rtg-math.matrix4.common.

Source

matrices/matrix4/common.lisp.

Function: mrow*vec2 (vec2-to-mutate mat-a)

{TODO}

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: mrow*vec2 (vec mat-a)

{TODO}

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: mrow*vec3 (vec mat-a)

{TODO}

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: mrow*vec3 (vec3-to-mutate mat-a)

{TODO}

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: mrow*vec4 (vec4-to-mutate mat-a)

{TODO}

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: mrow*vec4 (vec mat-a)

{TODO}

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: negate (vector-a)

Return a vector that is the negated version of the vector passed in

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: negate (mat-to-negate)

Negates the components of the ‘mat4‘

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: negate (vector-a)

Return a vector that is the negated version of the vector passed in

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: negate (mat-a)

Negates the components of the ‘mat3‘

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: negate (vector-a)

Destructively negates the given vector

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: negate (vec)

Negates the given vector. Returns a new vector of the same kind.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: negate (mat-to-negate)

Negates the components of the ‘mat2‘

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: negate (mat-a)

Negates the components of the ‘mat4‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: negate (matrix-a)

Returns a fresh matrix with all the components negated

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: negate (vector-a)

Destructively negates the given vector

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: negate (mat-a)

Negates the components of the ‘mat2‘

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: negate (mat-to-negate)

Negates the components of the ‘mat3‘

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: negate (vector-a)

Return a vector that is the negated version of the vector passed in

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: negate (vector-a)

Destructively negates the given vector

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: norm (quat)

Returns the ’norm’ of the ‘quaternion‘

Note: This is not the normalized verison of the quaternion, that is performed by the ‘normalize‘ function.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: normalize (vector-a)

This normalizes the given ‘vec4‘.

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: normalize (vector-a)

This normalizes the given ‘vec2‘.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: normalize (vector-a)

Destructively normalizes the vector

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: normalize (quat)

Returns a fresh, normalized version of the given vector.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: normalize (vec-a)

Normalizes the vector. Returns a new vector of the same kind.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: normalize (quat-to-mutate)

Destructively replaces the given ‘quaternion‘ with the normalized version of itself.

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: normalize (vector-a)

Destructively normalizes the vector

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: normalize (vector-a)

This normalizes the given ‘vec3‘.

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: normalize (vector-a)

Destructively normalizes the vector

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: origin (ray3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: origin (line3)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: orthographic (mat4-to-mutate frame-width frame-height near far)

Creates a ‘mat4‘ and mutates it to be an orthographic projection matrix

Package

rtg-math.projection.non-consing.

Source

projection/orthographic/non-consing.lisp.

Function: orthographic (frame-width frame-height near far)

Creates a new orthographic projection matrix (mat4)

Package

rtg-math.projection.

Source

projection/orthographic/consing.lisp.

Function: orthographic-v2 (mat4-to-mutate frame-size-v2 near far)

Creates a ‘mat4‘ and mutates it to be an orthographic projection matrix (with the frame size specified by a ‘vec2‘)

Package

rtg-math.projection.non-consing.

Source

projection/orthographic/non-consing.lisp.

Function: orthographic-v2 (frame-size-v2 near far)

Creates a new orthographic projection matrix (mat4) with the frame size specified by a ‘vec2‘

Package

rtg-math.projection.

Source

projection/orthographic/consing.lisp.

Function: perp-dot (vec-a vec-b)

{TODO}

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: perp-dot (vec-a vec-b)

{TODO}

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: perspective (mat-to-mutate width height near far fov-degrees)

Takes a ‘mat4‘ and mutates it to be a perspective matrix with the field of view being specified in degrees.

The fact that the primary function form takes degress is unusual
in rtg-math. We keep it this way for backwards compatibility. For
the version specified in radians see ‘perspective-radian-fov‘

Package

rtg-math.projection.non-consing.

Source

projection/perspective/non-consing.lisp.

Function: perspective (width height near far fov-degrees)

Creates a perspective matrix (‘mat4‘) with the field of view being specified in degrees.

The fact that the primary function form takes degress is unusual in rtg-math. We keep it this way for backwards compatibility. For the version specified in radians see ‘perspective-radian-fov‘

Package

rtg-math.projection.

Source

projection/perspective/consing.lisp.

Function: perspective-radian-fov (mat-to-mutate width height near far fov)

Takes a ‘mat4‘ and mutates it to be a perspective matrix

Package

rtg-math.projection.non-consing.

Source

projection/perspective/non-consing.lisp.

Function: perspective-radian-fov (width height near far fov)

Creates a perspective matrix (‘mat4‘).

Package

rtg-math.projection.

Source

projection/perspective/consing.lisp.

Function: perspective-v2 (mat-to-mutate frame-size-v2 near far fov-degrees)

Takes a ‘mat4‘ and mutates it to be a perspective matrix with the frame size specified using a ‘vec2‘ and the field of view being specified in degrees.

This variant of ‘perspective‘ that is provided as some libraries will provide the framesize as a ‘vec2‘ so it felt right to support that rather
that force unpacking.

The fact that the primary function form takes degress is unusual
in rtg-math. We keep it this way for backwards compatibility. For
the version specified in radians see ‘perspective-radian-fov‘

Package

rtg-math.projection.non-consing.

Source

projection/perspective/non-consing.lisp.

Function: perspective-v2 (frame-size-v2 near far fov-degrees)

Creates a perspective matrix (‘mat4‘) with the frame size specified using a ‘vec2‘ and the field of view being specified in degrees.

This variant of ‘perspective‘ that is provided as some libraries will provide the framesize as a ‘vec2‘ so it felt right to support that rather
that force unpacking.

The fact that the primary function form takes degress is unusual
in rtg-math. We keep it this way for backwards compatibility. For
the version specified in radians see ‘perspective-radian-fov‘

Package

rtg-math.projection.

Source

projection/perspective/consing.lisp.

Function: perspective-v2-radian-fov (mat-to-mutate frame-size-v2 near far fov-degrees)

Takes a ‘mat4‘ and mutates it to be a perspective matrix with the frame size specified using a ‘vec2‘

This variant of ‘perspective‘ that is provided as some libraries will provide the framesize as a ‘vec2‘ so it felt right to support that rather
that force unpacking.

Package

rtg-math.projection.non-consing.

Source

projection/perspective/non-consing.lisp.

Function: perspective-v2-radian-fov (frame-size-v2 near far fov-radians)

Creates a perspective matrix (‘mat4‘) with the frame size specified using a ‘vec2‘

This variant of ‘perspective‘ that is provided as some libraries will provide the framesize as a ‘vec2‘ so it felt right to support that rather
that force unpacking.

Package

rtg-math.projection.

Source

projection/perspective/consing.lisp.

Function: point-at (up from3 to3)

Create the ‘mat3‘ rotation portion to a ’world to view’ ’look-at’ matrix

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: point-at (up3 from3 to3)

Creates a ‘quaternion‘ that

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: point-at (up from3 to3)

Create the ‘mat4‘ rotation portion to a ’world to view’ ’look-at’ matrix

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: polar->cartesian (angle-length-v2)
Package

rtg-math.polar.

Source

polar-coords/polar.lisp.

Function: q! (w x y z)

Make a ‘quaternion‘ from 4 ‘single-float‘s

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: qconjugate (quat)

Deprecated: Please use ‘conjugate‘

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: radians-f (degrees)

Converts a quantity, specified in degrees as a ‘single-float‘ into radians.

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Function: rotate (vec angle)

Creates a new ‘vec2‘ which is equivilent to the original once rotated counterclockwise by ‘angle‘ radians.

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: rotate (vec angle)

Rotates the give ‘vec2‘ counterclockwise by ‘angle‘ radians.

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: rotate (vec3 quat)

Rotates the given ‘vec3‘ using the ‘quaternion‘.

Assumes the ‘quaternion‘ is normalized.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: rotate (vec3-to-mutate quat)

Destructively rotates the ‘vec3‘ using the ‘quaternion‘ returning the mutated ‘vec3‘.

ssumes quaternion is normalized.

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: rotate (vec rotation)

Creates a new ‘vec3‘ which is equivilent to the original once rotated in each axis by the radians in the ‘rotation‘ vec3 provided.

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: rotate (vec rotation)

Rotates the given ‘vec3‘ counterclockwise by the radians in the ‘rotation‘ vec3 provided.

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: rotation-from-axis-angle (axis3 angle)

Returns a ‘mat3‘ which will rotate a point about the axis specified by the angle provided

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: rotation-from-axis-angle (axis3 angle)

Returns a ‘mat4‘ which will rotate a point about the axis specified by the angle provided

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: rotation-from-euler (vec3-a)

Creates a rotation ‘mat3‘ which represents a anticlockwise rotation.

The angle is specified in radians

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: rotation-from-euler (vec3-a)

Creates a rotation ‘mat4‘ which represents a anticlockwise rotation.

The angle is specified in radians

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: rotation-from-euler (angle)

Creates a rotation ‘mat2‘ which represents a anticlockwise rotation.

The angle is specified in radians

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: rotation-from-mat3 (m-a)

Takes a ‘mat3‘ rotation matrix and returns a ‘mat4‘ rotation matrix with the same values. The 4th row & column are filled as an identity matrix would be.

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: rotation-x (angle)

Returns a ‘mat3‘ which would rotate a point around the x axis by the specified amount

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: rotation-x (angle)

Returns a ‘mat4‘ which would rotate a point around the x axis by the specified amount

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: rotation-y (angle)

Returns a ‘mat3‘ which would rotate a point around the y axis by the specified amount

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: rotation-y (angle)

Returns a ‘mat4‘ which would rotate a point around the y axis by the specified amount

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: rotation-z (angle)

Returns a ‘mat3‘ which would rotate a point around the z axis by the specified amount

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: rotation-z (angle)

Returns a ‘mat4‘ which would rotate a point around the z axis by the specified amount

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: saturate (val-f)

clamps the given ‘single-float‘ between 0.0 and 1.0

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Function: scale (scale-vec3)

Returns a matrix which will scale by the amounts specified

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: scale (scale-vec3)

Returns a matrix which will scale by the amounts specified

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: scale (scale-vec2)

Returns a matrix which will scale by the amounts specified

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: set-components (c00 c01 c02 c03 c10 c11 c12 c13 c20 c21 c22 c23 c30 c31 c32 c33 mat4-to-mutate)

Destructively updates of the components of the given ‘mat4‘ to the new ‘single-float‘s provided.

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-components (x y vec)

Destructively updates of the components of the given ‘vec2‘ to the new ‘single-float‘s provided.

Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: set-components (c00 c01 c10 c11 mat2-to-mutate)

Destructively updates of the components of the given ‘mat2‘ to the new ‘single-float‘s provided.

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: set-components (x y z w vec)

Destructively updates of the components of the given ‘vec2‘ to the new ‘single-float‘s provided.

Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: set-components (c00 c01 c02 c10 c11 c12 c20 c21 c22 mat3-to-mutate)

Destructively updates of the components of the given ‘mat3‘ to the new ‘single-float‘s provided.

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: set-components (x y z vec)

Destructively updates of the components of the given ‘vec3‘ to the new ‘single-float‘s provided.

Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: set-from-columns (mat-to-mutate col-1 col-2 col-3 col-4)

Destructively updates of the components of the given ‘mat4‘ using the 4 ‘vec4‘s provided to populate the columns

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-from-columns (mat-to-mutate col-1 col-2)

Destructively updates of the components of the given ‘mat2‘ using the 2 ‘vec2‘s provided to populate the columns

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: set-from-columns (mat-to-mutate col-1 col-2 col-3)

Destructively updates of the components of the given ‘mat3‘ using the 3 ‘vec3‘s provided to populate the columns

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: set-from-columns-v3 (mat-to-mutate col-1 col-2 col-3)

Make a ‘mat4‘ using the data in the 3 ‘vec3‘ provided to populate the columns

The 4th row & column is filled as an identity matrix would be.

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-from-mat3 (mat-to-mutate m-a)

Destructively updates of the components of the given ‘mat4‘ making it’s top left 3x3 portion the same as the ‘mat3‘ provided.

The 4th row & column is filled as an identity matrix would be.

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-from-rotation-x (mat-to-mutate angle)

Destructively updates of the components of the given ‘mat4‘ making it a matrix which would rotate a point around the x axis by the specified amount

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-from-rotation-x (mat-to-mutate angle)

Destructively updates of the components of the given ‘mat3‘ making it a matrix which would rotate a point around the x axis by the specified amount

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: set-from-rotation-y (mat-to-mutate angle)

Destructively updates of the components of the given ‘mat4‘ making it a matrix which would rotate a point around the y axis by the specified amount

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-from-rotation-y (mat-to-mutate angle)

Destructively updates of the components of the given ‘mat3‘ making it a matrix which would rotate a point around the y axis by the specified amount

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: set-from-rotation-z (mat-to-mutate angle)

Destructively updates of the components of the given ‘mat4‘ making it a matrix which would rotate a point around the z axis by the specified amount

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-from-rotation-z (mat-to-mutate angle)

Destructively updates of the components of the given ‘mat3‘ making it a matrix which would rotate a point around the z axis by the specified amount

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: set-from-rows (mat-to-mutate row-1 row-2 row-3 row-4)

Destructively updates of the components of the given ‘mat4‘ using the 4 ‘vec4‘s provided to populate the rows

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-from-rows (mat-to-mutate row-1 row-2)

Destructively updates of the components of the given ‘mat2‘ using the 2 ‘vec2‘s provided to populate the rows

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: set-from-rows (mat-to-mutate row-1 row-2 row-3)

Destructively updates of the components of the given ‘mat3‘ using the 3 ‘vec3‘s provided to populate the rows

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: set-from-rows-v3 (mat-to-mutate row-1 row-2 row-3)

Make a ‘mat4‘ using the data in the 3 ‘vec3‘ provided to populate the rows

The 4th row & column is filled as an identity matrix would be.

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-from-scale (mat-to-mutate scale-vec3)

Mutates the given ‘mat4‘ to be a matrix which will scale by the amounts specified

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-from-scale (mat-to-mutate scale-vec2)

Mutates the given ‘mat2‘ to be a which will scale by the amounts specified

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: set-from-scale (mat-to-mutate scale-vec3)

Mutates the given ‘mat3‘ to be a matrix which will scale by the amounts specified

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: set-from-translation (mat-to-mutate vec-a)

Destructively updates of the components of the given ‘mat4‘ making it a matrix which which will translate a point by the specified amount

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-rotation-from-axis-angle (mat-to-mutate axis3 angle)

Destructively updates of the components of the given ‘mat4‘ making it a matrix which will rotate a point about the axis specified by the angle provided

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-rotation-from-axis-angle (mat-to-mutate axis3 angle)

Destructively updates of the components of the given ‘mat3‘ making it a matrix which will rotate a point about the axis specified by the angle provided

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: set-rotation-from-euler (mat-to-mutate vec3-a)

Destructively modifies the ‘mat4‘ to be a rotation matrix whos rotation angles come from the ‘vec3‘ provided.

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: set-rotation-from-euler (mat-to-mutate angle)

Destructively modifies the ‘mat2‘ to be a rotation matrix whos rotation angle comes from the single-float provided.

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: set-rotation-from-euler (mat-to-mutate vec3-a)

Destructively modifies the ‘mat3‘ to be a rotation matrix whos rotation angles come from the ‘vec3‘ provided.

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: slerp (start-quat end-quat pos)

Spherically interpolate between two quaternions. Note that this will always take the shortest path.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: spherical->cartesian (spherical-coord-v3)

Takes a spherical coord vector with the layout (θ φ ρ) and converts it to a cartesian vector3.

Notes:
θ - angle between υ and x axis (rotating around z) φ - angle between υ and z axis
ρ - distance from origin (lengh of υ)

Package

rtg-math.spherical.

Source

spherical-coords/spherical.lisp.

Function: spline (x knots)

{TODO}

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: spline (x knots)

{TODO}

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: spline (x knots)

{TODO}

Package

rtg-math.base-maths.

Source

base-maths.lisp.

Function: spline (x knots)

{TODO}

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: swizzle (vec pattern)

‘Swizzle‘ allows you to compose a new vector out of an existing one by picking it’s components.

Given a ‘vec3‘ called ‘a‘ = ‘(v! 1 2 3)‘

- ‘(swizzle a :xy)‘ → (v! 1 2)
- ‘(swizzle a :xx)‘ → (v! 1 1)
- ‘(swizzle a :yx)‘ → (v! 2 1)
- ‘(swizzle a :yyyy)‘ → (v! 2 2 2 2)
- ‘(swizzle a :zzyy)‘ → (v! 3 3 2 2)

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: (setf swizzle) (vec pattern)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: s~ (vec pattern)

Shorthand for ‘swizzle‘

‘s~‘ allows you to compose a new vector out of an existing one by picking it’s components.

Given a ‘vec3‘ called ‘a‘ = ‘(v! 1 2 3)‘

- ‘(s~ a :xy)‘ → (v! 1 2)
- ‘(s~ a :xx)‘ → (v! 1 1)
- ‘(s~ a :yx)‘ → (v! 2 1)
- ‘(s~ a :yyyy)‘ → (v! 2 2 2 2)
- ‘(s~ a :zzyy)‘ → (v! 3 3 2 2)

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: (setf s~) (vec pattern)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: to-direction (quat)

Returns a new ‘vec3‘ is equal to ‘(v! 0 0 -1)‘ having been rotated by the given ‘quaternion‘

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: to-direction-vec4 (quat)

Returns a new ‘vec4‘ is equal to ‘(v! 0 0 -1 0)‘ having been rotated by the given ‘quaternion‘

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: to-mat3 (quat)

Returns a new ‘mat3‘ which represents the same rotation as the given ‘quaternion‘

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: to-mat3 (mat4)

Returns a fresh ‘mat3‘ which contains the ’top left’ 3x3 portion of the given ‘mat4‘

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: to-mat3 (mat-to-mutate quat)

Given a ‘quaternion‘ and a ‘mat3‘ to mutate this function will mutate the ‘mat3‘ such that it represents the same rotation as the ‘quaternion‘ does.

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: to-mat4 (quat)

Returns a new ‘mat4‘ which represents the same rotation as the given ‘quaternion‘ (and zero translation)

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: to-mat4 (mat-to-mutate quat)

Given a ‘quaternion‘ and a ‘mat4‘ to mutate this function will mutate the ‘mat4‘ such that it represents the same rotation as the ‘quaternion‘ does.

Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: to-string (mat)

{TODO}

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: trace (mat-a)

Returns the trace of the matrix (That is the diagonal values)

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: trace (mat-a)

Returns the trace of the matrix (That is the diagonal values)

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: trace (matrix-a)

Returns the trace of the given matrix as a vector

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: trace (mat-a)

Returns the trace of the matrix (That is the diagonal values)

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: transform-m3 (matrix3 ray3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: transform-m3 (matrix3 line3)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: transform-m3 (matrix3 line-seg3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: transform-q (quat ray3)
Package

rtg-math.region.ray3.

Source

regions/ray3/consing.lisp.

Function: transform-q (quat line3)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: transform-q (quat line-seg3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: translation (vec-a)

Takes a ‘vec3‘ and returns a ‘mat4‘ which will translate by the specified amount

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: transpose (mat-to-transpose)

Mutates the given ‘mat4‘ to be it’s own transpose

Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: transpose (mat-a)

Returns the transpose of the provided matrix

Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: transpose (mat-to-transpose)

Mutates the given ‘mat2‘ to be it’s own transpose

Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: transpose (m-a)

Returns the transpose of the provided matrix

Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: transpose (matrix-a)

Returns the transpose of the given matrix

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: transpose (mat-a)

Returns the transpose of the provided matrix

Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: transpose (mat-to-transpose)

Mutates the given ‘mat3‘ to be it’s own transpose

Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: unitp (vector-a)

Checks if the vector is of unit length. As this is a
floating point number it checks to see if the length is
within the range of 1 + or - and threshold set in base-maths

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: unitp (vector-a)

Checks if the vector is of unit length. As this is a
floating point number it checks to see if the length is
within the range of 1 + or - and threshold set in base-maths

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: unitp (quat)

Returns T if this is a unit quaternion.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: unitp (vec-a)

Returns T is the given vector has a length eql to 1

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: unitp (matrix)

Returns T if the matrix is the unit matrix.

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: unitp (vector-a)

Checks if the vector is of unit length. As this is a
floating point number it checks to see if the length is
within the range of 1 + or - and threshold set in base-maths

Note: Old, float epsilons are tricky, I have a ticket open to review this

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: v! (&rest components)

Create a vec2, vec3 or vec4. The kind of vector returned by this function depends on what is passed as the arguments.

It can take any number of the following..

- floats
- integers
- vec2
- vec3
- vec4

so long as the total number of components is 2, 3 or 4. So any of the following examples are valid:

- ‘(v! 1 2 3 4)‘
- ‘(v! 1.0 2 3.0 4)‘
- ‘(v! 1 (v! 2 3) 4)‘
- ‘(v! (v! 1 2) (v! 3 4))‘
- ‘(v! (v! 1 2 3) 4.0)‘

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!bool (&rest components)

Create a vector of 2, 3 or 4 booleans out of booleans or other boolean vectors

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!byte (&rest components)

a vector of 2, 3 or 4 bytes out of bytes or other byte vectors

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!double (&rest components)

Create a vector of 2, 3 or 4 doubles out of doubles or other double vectors

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!int (&rest components)

Create a vector of 2, 3 or 4 ints out of ints or other int vectors

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!int8 (&rest components)

Create a vector of 2, 3 or 4 int8s out of int8s or other int8 vectors

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!ubyte (&rest components)

Create a vector of 2, 3 or 4 ubytes out of ubytes or other ubyte vectors

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!uint (&rest components)

Create a vector of 2, 3 or 4 uints out of uints or other uint vectors

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!uint8 (&rest components)

Create a vector of 2, 3 or 4 uint8s out of uint8s or other uint8 vectors

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2! (x &optional y)

Create vec2 from 1 or 2 floats or ints

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2!byte (x &optional y)

Create vector of two bytes from 1 or 2 bytes

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2!double (x &optional y)

Create vector of two doubles from 1 or 2 doubles

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2!int (x &optional y)

Create vector of two ints from 1 or 2 ints

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2!int8 (x &optional y)

Create vector of two int8s from 1 or 2 int8s

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2!short (x &optional y)

Create vector of two shorts from 1 or 2 shorts

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2!ubyte (x &optional y)

Create vector of two ubytes from 1 or 2 ubytes

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2!uint (x &optional y)

Create vector of two uints from 1 or 2 uints

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2!uint8 (x &optional y)

Create vector of two uint8s from 1 or 2 uint8s

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v2!ushort (x &optional y)

Create vector of two ushorts from 1 or 2 ushorts

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3! (x &optional y z)

Create a vec3 from 1, 2 or 3 floats or ints.

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3!byte (x &optional y z)

Creates a vector of 3 bytes from 1, 2 or 3 bytes

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3!double (x &optional y z)

Creates a vector of 3 doubles from 1, 2 or 3 doubles

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3!int (x &optional y z)

Creates a vector of 3 ints from 1, 2 or 3 ints

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3!int8 (x &optional y z)

Creates a vector of 3 int8s from 1, 2 or 3 int8s

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3!short (x &optional y z)

Creates a vector of 3 shorts from 1, 2 or 3 shorts

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3!ubyte (x &optional y z)

Creates a vector of 3 ubytes from 1, 2 or 3 ubytes

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3!uint (x &optional y z)

Creates a vector of 3 uints from 1, 2 or 3 uints

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3!uint8 (x &optional y z)

Creates a vector of 3 uint8s from 1, 2 or 3 uint8s

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v3!ushort (x &optional y z)

Creates a vector of 3 ushorts from 1, 2 or 3 ushorts

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4! (x &optional y z w)

Create a vec4 from 1, 2, 3 or 4 floats or ints

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4!byte (x &optional y z w)

Creates a vector of 4 bytes from 1, 2, 3 or 4 bytes

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4!double (x &optional y z w)

Creates a vector of 4 doubles from 1, 2, 3 or 4 doubles

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4!int (x &optional y z w)

Creates a vector of 4 ints from 1, 2, 3 or 4 ints

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4!int8 (x &optional y z w)

Creates a vector of 4 int8s from 1, 2, 3 or 4 int8s

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4!short (x &optional y z w)

Creates a vector of 4 shorts from 1, 2, 3 or 4 shorts

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4!ubyte (x &optional y z w)

Creates a vector of 4 ubytes from 1, 2, 3 or 4 ubytes

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4!uint (x &optional y z w)

Creates a vector of 4 uints from 1, 2, 3 or 4 uints

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4!uint8 (x &optional y z w)

Creates a vector of 4 uint8s from 1, 2, 3 or 4 uint8s

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v4!ushort (x &optional y z w)

Creates a vector of 4 ushorts from 1, 2, 3 or 4 ushorts

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: w (vec)

Returns the w component of the vector

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: (setf w) (vec)

Sets the w component of the vector

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: w (quat)

Returns the w component of the quaternion

Package

%rtg-math.quaternion.common.

Source

quaternions/common.lisp.

Function: (setf w) (quat)

Returns the w component of the quaternion

Package

%rtg-math.quaternion.common.

Source

quaternions/common.lisp.

Function: x (vec)

Returns the x component of the vector

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: (setf x) (vec)

Sets the x component of the vector

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: x (quat)

Returns the x component of the quaternion

Package

%rtg-math.quaternion.common.

Source

quaternions/common.lisp.

Function: (setf x) (quat)

Returns the x component of the quaternion

Package

%rtg-math.quaternion.common.

Source

quaternions/common.lisp.

Function: y (vec)

Returns the y component of the vector

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: (setf y) (vec)

Sets the y component of the vector

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: y (quat)

Returns the y component of the quaternion

Package

%rtg-math.quaternion.common.

Source

quaternions/common.lisp.

Function: (setf y) (quat)

Returns the y component of the quaternion

Package

%rtg-math.quaternion.common.

Source

quaternions/common.lisp.

Function: z (vec)

Returns the z component of the vector

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: (setf z) (vec)

Sets the z component of the vector

Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: z (quat)

Returns the z component of the quaternion

Package

%rtg-math.quaternion.common.

Source

quaternions/common.lisp.

Function: (setf z) (quat)

Returns the z component of the quaternion

Package

%rtg-math.quaternion.common.

Source

quaternions/common.lisp.


5.1.5 Generic functions

Generic Function: closest-point (reg-a vec3)
Package

rtg-math.region.

Source

regions/regions.lisp.

Methods
Method: closest-point ((point-vec3 array) (reg line-segment3))
Method: closest-point ((reg line-segment3) (point-vec3 array))
Method: closest-point ((point-vec3 array) (reg ray3))
Method: closest-point ((reg ray3) (point-vec3 array))
Method: closest-point ((point-vec3 array) (reg line3))
Method: closest-point ((reg line3) (point-vec3 array))
Generic Function: closest-points (reg-a reg-b)
Package

rtg-math.region.

Source

regions/regions.lisp.

Methods
Method: closest-points ((reg-a line3) (reg-b line-segment3))
Method: closest-points ((reg-a line-segment3) (reg-b line3))
Method: closest-points ((reg-a ray3) (reg-b line-segment3))
Method: closest-points ((reg-a line-segment3) (reg-b ray3))
Method: closest-points ((reg-a line-segment3) (reg-b line-segment3))
Method: closest-points ((reg-a ray3) (reg-b ray3))
Method: closest-points ((reg-a line3) (reg-b line3))
Generic Function: distance (reg-a reg-b)
Package

rtg-math.region.

Source

regions/regions.lisp.

Methods
Method: distance ((reg-a line-segment3) (reg-b line3))
Method: distance ((reg-a line3) (reg-b line-segment3))
Method: distance ((reg-a line-segment3) (reg-b ray3))
Method: distance ((reg-a ray3) (reg-b line-segment3))
Method: distance ((reg-a line3) (reg-b ray3))
Method: distance ((reg-a ray3) (reg-b line3))
Method: distance ((reg-a line3) (reg-b line3))
Method: distance ((reg-a ray3) (reg-b ray3))
Method: distance ((reg-a line-segment3) (reg-b line-segment3))
Generic Function: distance-squared (reg-a reg-b)
Package

rtg-math.region.

Source

regions/regions.lisp.

Methods
Method: distance-squared ((reg-a line-segment3) (reg-b line3))
Method: distance-squared ((reg-a line3) (reg-b line-segment3))
Method: distance-squared ((reg-a line-segment3) (reg-b ray3))
Method: distance-squared ((reg-a ray3) (reg-b line-segment3))
Method: distance-squared ((reg-a line3) (reg-b ray3))
Method: distance-squared ((reg-a ray3) (reg-b line3))
Method: distance-squared ((reg-a line3) (reg-b line3))
Method: distance-squared ((reg-a ray3) (reg-b ray3))
Method: distance-squared ((reg-a line-segment3) (reg-b line-segment3))
Generic Function: intersects-p (reg-a reg-b)
Package

rtg-math.region.

Source

regions/regions.lisp.

Methods
Method: intersects-p ((reg-a axis-aligned-box) (reg-b axis-aligned-box))
Method: intersects-p ((reg-a line-segment3) (reg-b axis-aligned-box))
Method: intersects-p ((reg-a axis-aligned-box) (reg-b line-segment3))
Method: intersects-p ((reg-a ray3) (reg-b axis-aligned-box))
Method: intersects-p ((reg-a axis-aligned-box) (reg-b ray3))
Method: intersects-p ((reg-a line3) (reg-b axis-aligned-box))
Method: intersects-p ((reg-a axis-aligned-box) (reg-b line3))

5.1.6 Structures

Structure: axis-aligned-box
Package

rtg-math.types.

Source

deftypes.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: minima
Type

glsl-symbols.types:vec3

Initform

(make-array 3 :element-type (quote single-float) :initial-element -1.0)

Readers

axis-aligned-box-minima.

Writers

(setf axis-aligned-box-minima).

Slot: maxima
Type

glsl-symbols.types:vec3

Initform

(make-array 3 :element-type (quote single-float) :initial-element 1.0)

Readers

axis-aligned-box-maxima.

Writers

(setf axis-aligned-box-maxima).

Structure: line-segment3
Package

rtg-math.types.

Source

deftypes.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: end-point0
Type

glsl-symbols.types:vec3

Initform

(make-array 3 :element-type (quote single-float) :initial-element 0.0)

Readers

line-segment3-end-point0.

Writers

(setf line-segment3-end-point0).

Slot: offset
Type

glsl-symbols.types:vec3

Initform

(make-array 3 :element-type (quote single-float) :initial-contents (quote (0.0 1.0 0.0)))

Readers

line-segment3-offset.

Writers

(setf line-segment3-offset).

Structure: line3
Package

rtg-math.types.

Source

deftypes.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: origin
Type

glsl-symbols.types:vec3

Initform

(make-array 3 :element-type (quote single-float) :initial-element 0.0)

Readers

line3-origin.

Writers

(setf line3-origin).

Slot: direction
Type

glsl-symbols.types:vec3

Initform

(make-array 3 :element-type (quote single-float) :initial-element 1.0)

Readers

line3-direction.

Writers

(setf line3-direction).

Structure: ray3
Package

rtg-math.types.

Source

deftypes.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: origin
Type

glsl-symbols.types:vec3

Initform

(make-array 3 :element-type (quote single-float) :initial-element 0.0)

Readers

ray3-origin.

Writers

(setf ray3-origin).

Slot: direction
Type

glsl-symbols.types:vec3

Initform

(make-array 3 :element-type (quote single-float) :initial-element 1.0)

Readers

ray3-direction.

Writers

(setf ray3-direction).


5.1.7 Types

Type: int8-vec2 ()

A ‘simple-array‘ of 2 ‘(signed-byte 8)‘s

Package

rtg-math.types.

Source

deftypes.lisp.

Type: int8-vec3 ()

A ‘simple-array‘ of 3 ‘(signed-byte 8)‘s

Package

rtg-math.types.

Source

deftypes.lisp.

Type: int8-vec4 ()

A ‘simple-array‘ of 4 ‘(signed-byte 8)‘s

Package

rtg-math.types.

Source

deftypes.lisp.

Type: quaternion ()
Package

rtg-math.types.

Source

deftypes.lisp.

Type: uint8-vec2 ()

A ‘simple-array‘ of 2 ‘(unsigned-byte 8)‘s

Package

rtg-math.types.

Source

deftypes.lisp.

Type: uint8-vec3 ()

A ‘simple-array‘ of 3 ‘(unsigned-byte 8)‘s

Package

rtg-math.types.

Source

deftypes.lisp.

Type: uint8-vec4 ()

A ‘simple-array‘ of 4 ‘(unsigned-byte 8)‘s

Package

rtg-math.types.

Source

deftypes.lisp.


5.2 Internals


5.2.1 Constants

Constant: +k-epsilon+
Package

rtg-math.base-maths.

Source

base-maths.lisp.

Constant: +one-radian-in-degrees+
Package

rtg-math.base-maths.

Source

base-maths.lisp.


5.2.2 Special variables

Special Variable: *coef*
Package

rtg-math.base-maths.

Source

base-maths.lisp.

Special Variable: *signatures*
Package

%rtg-math.

Source

utils.lisp.


5.2.3 Macros

Macro: def-v! (name type)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Macro: dvec (var-list expression &body body)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Macro: dvec* (var-list-expression-pairs &body body)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.


5.2.4 Compiler macros

Compiler Macro: v!short (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Compiler Macro: v!ushort (&rest components)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.


5.2.5 Ordinary functions

Function: %* (mat-accum to-multiply-mat)
Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: %* (mat-a mat-b)
Package

rtg-math.matrix3.

Source

matrices/matrix3/consing.lisp.

Function: %* (accum-vec to-mult-vec)
Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: %* (mat-accum to-multiply-mat)
Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: %* (mat-a mat-b)
Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Function: %* (accum-vec to-mult-vec)
Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: %* (mat-a mat-b)
Package

rtg-math.matrix2.

Source

matrices/matrix2/consing.lisp.

Function: %* (mat-accum to-multiply-mat)
Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: %* (accum-vec to-mult-vec)
Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: %+ (vector-a vector-b)

Add two vectors and return a new vector containing the result

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: %+ (vector-a vector-b)
Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: %+ (accum-vec to-add-vec)
Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: %+ (quat-a quat-b)
Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: %+ (accum-quat to-add-quat)
Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: %+ (accum-vec to-add-vec)
Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: %+ (vector-a vector-b)

Add two vectors and return a new vector containing the result

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: %+ (accum-vec to-add-vec)
Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: %- (vector-a vector-b)

Subtract two vectors and return a new vector containing the result

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: %- (vector-a vector-b)
Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: %- (accum-vec to-add-vec)
Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: %- (quat-a quat-b)
Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: %- (accum-quat to-add-quat)
Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: %- (accum-vec to-add-vec)
Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: %- (vector-a vector-b)

Subtract two vectors and return a new vector containing the result

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: %- (accum-vec to-add-vec)
Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: %decf (vec delta)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: %defn (name typed-args result-types inlinable-p inline-p body)
Package

%rtg-math.

Source

utils.lisp.

Function: %incf (vec delta)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: %make-vector (x y &optional z w)

This takes floats and give back a vector, this is just an array but it specifies the array type and populates it.

Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: %seg-to-ray-internals (line-seg3 ray3)

Returns: dir-a dir-b w0 tc sc

Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: %seg-to-seg-internals (line-seg-a line-seg-b)

Returns: dir-a dir-b w0 tc sc

Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Function: *v (vector-a vector-b)

Component-wise multiplication of two ‘vec4‘

Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: *v (vector-a vector-b)

Component-wise multiplication of two ‘vec2‘

Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: *v (vector-a vector-b)

Component-wise multiplication of two ‘vec3‘

Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: /= (line3-a line3-b)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Function: = (line3-a line3-b)
Package

rtg-math.region.line3.

Source

regions/line3/consing.lisp.

Reader: axis-aligned-box-maxima (instance)
Writer: (setf axis-aligned-box-maxima) (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Target Slot

maxima.

Reader: axis-aligned-box-minima (instance)
Writer: (setf axis-aligned-box-minima) (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Target Slot

minima.

Function: axis-aligned-box-p (object)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: bias (b x)
Package

rtg-math.base-maths.

Source

base-maths.lisp.

Function: closest-point-on-line (line point)
Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: closest-point-on-norm-line (line point)
Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: copy-axis-aligned-box (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: copy-components (mat copy-from)
Package

rtg-math.matrix4.non-consing.

Source

matrices/matrix4/non-consing.lisp.

Function: copy-components (vec copy-from)
Package

rtg-math.vector2.non-consing.

Source

vectors/vector2/non-consing.lisp.

Function: copy-components (mat copy-from)
Package

rtg-math.matrix2.non-consing.

Source

matrices/matrix2/non-consing.lisp.

Function: copy-components (vec copy-from)
Package

rtg-math.vector4.non-consing.

Source

vectors/vector4/non-consing.lisp.

Function: copy-components (mat copy-from)
Package

rtg-math.matrix3.non-consing.

Source

matrices/matrix3/non-consing.lisp.

Function: copy-components (vec copy-from)
Package

rtg-math.vector3.non-consing.

Source

vectors/vector3/non-consing.lisp.

Function: copy-line-segment3 (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: copy-line3 (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: copy-ray3 (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: distance-to-line-sq (line point)
Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: distance-to-norm-line-sq (line point)
Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: floatify (vec)
Package

rtg-math.vectors.

Source

vectors/vectors.lisp.

Function: from-fixed-angles-unnormalized (quat-to-mutate x-rot y-rot z-rot)
Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: gain (g x)
Package

rtg-math.base-maths.

Source

base-maths.lisp.

Reader: line-segment3-end-point0 (instance)
Writer: (setf line-segment3-end-point0) (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Target Slot

end-point0.

Function: line-segment3-end-point1 (line-seg3)
Package

rtg-math.region.line-segment3.

Source

regions/line-segment3/consing.lisp.

Reader: line-segment3-offset (instance)
Writer: (setf line-segment3-offset) (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Target Slot

offset.

Function: line-segment3-p (object)
Package

rtg-math.types.

Source

deftypes.lisp.

Reader: line3-direction (instance)
Writer: (setf line3-direction) (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Target Slot

direction.

Reader: line3-origin (instance)
Writer: (setf line3-origin) (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Target Slot

origin.

Function: line3-p (object)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: m!one-arg (x)
Package

rtg-math.base-matrices.

Source

matrices/base/base-matrices.lisp.

Function: make-axis-aligned-box (&key minima maxima)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: make-line-segment3 (&key end-point0 offset)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: make-line3 (&key origin direction)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: make-ray3 (&key origin direction)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: melm (matrix row col)

Returns the specific component from the matrix

Package

rtg-math.matrices.

Source

matrices/matrices.lisp.

Function: parse-defn-args (typed-args result-types)
Package

%rtg-math.

Source

utils.lisp.

Function: print-m4 (m4)
Package

rtg-math.matrix4.

Source

matrices/matrix4/consing.lisp.

Reader: ray3-direction (instance)
Writer: (setf ray3-direction) (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Target Slot

direction.

Reader: ray3-origin (instance)
Writer: (setf ray3-origin) (instance)
Package

rtg-math.types.

Source

deftypes.lisp.

Target Slot

origin.

Function: ray3-p (object)
Package

rtg-math.types.

Source

deftypes.lisp.

Function: rotate-v4 (vec4 quat)

Rotates the given ‘vec4‘ by the ‘quaternion‘.

Assumes the ‘quaternion‘ is normalized.

Package

rtg-math.quaternions.

Source

quaternions/consing.lisp.

Function: set-components (w x y z quat)
Package

rtg-math.quaternions.non-consing.

Source

quaternions/non-consing.lisp.

Function: sfzero-p (f)
Package

rtg-math.base-maths.

Source

base-maths.lisp.

Function: stable-lerp (vector-a vector-b ammount)
Package

rtg-math.vector4.

Source

vectors/vector4/consing.lisp.

Function: stable-lerp (vector-a vector-b ammount)
Package

rtg-math.vector2.

Source

vectors/vector2/consing.lisp.

Function: stable-lerp (vector-a vector-b ammount)
Package

rtg-math.vector3.

Source

vectors/vector3/consing.lisp.

Function: unit-spherical->unit-cartesian (unit-spherical-coord)
Package

rtg-math.spherical.

Source

spherical-coords/spherical.lisp.

Function: v!bool-one-arg (x)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!one-arg-v! (x)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!one-arg-v!byte (x)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!one-arg-v!double (x)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!one-arg-v!int (x)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!one-arg-v!int8 (x)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!one-arg-v!short (x)
Package

rtg-math.base-vectors.

Source

vectors/base/base-vectors.lisp.

Function: v!one-arg-v!ubyte (x)
<