This is the l-math Reference Manual, version 0.4.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:34:32 2024 GMT+0.
l-math/l-math.asd
l-math/package.lisp
l-math/conditions.lisp
l-math/generics.lisp
l-math/vector.lisp
l-math/matrix.lisp
l-math/tests.lisp
l-math/vector-operations.lisp
l-math/operations.lisp
l-math/rotations.lisp
l-math/scale.lisp
l-math/translation.lisp
l-math/utility.lisp
l-math/interpolate.lisp
l-math/random.lisp
l-math/basis.lisp
l-math/spline.lisp
l-math/spline-interpolation.lisp
l-math/transform.lisp
The main system appears first, followed by any subsystem dependency.
l-math
A simple math library focused on linear algebra.
Rudolph Neeser <rudy.neeser@gmail.com>
GPLv3 with Classpath Exception
0.4.0
package.lisp
(file).
conditions.lisp
(file).
generics.lisp
(file).
vector.lisp
(file).
matrix.lisp
(file).
tests.lisp
(file).
vector-operations.lisp
(file).
operations.lisp
(file).
rotations.lisp
(file).
scale.lisp
(file).
translation.lisp
(file).
utility.lisp
(file).
interpolate.lisp
(file).
random.lisp
(file).
basis.lisp
(file).
spline.lisp
(file).
spline-interpolation.lisp
(file).
transform.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
l-math/l-math.asd
l-math/package.lisp
l-math/conditions.lisp
l-math/generics.lisp
l-math/vector.lisp
l-math/matrix.lisp
l-math/tests.lisp
l-math/vector-operations.lisp
l-math/operations.lisp
l-math/rotations.lisp
l-math/scale.lisp
l-math/translation.lisp
l-math/utility.lisp
l-math/interpolate.lisp
l-math/random.lisp
l-math/basis.lisp
l-math/spline.lisp
l-math/spline-interpolation.lisp
l-math/transform.lisp
l-math/conditions.lisp
package.lisp
(file).
l-math
(system).
dimension-error
(condition).
l-math-error
(condition).
dimension-error-dim1
(reader method).
dimension-error-dim1
(reader method).
dimension-error-dim2
(reader method).
dimension-error-dim2
(reader method).
l-math-error-format-arguments
(reader method).
l-math-error-format-control
(reader method).
operation-not-suported-operation-name
(reader method).
operation-not-supported
(condition).
operation-not-supported-extra-information
(reader method).
required-dimension-error
(condition).
spline-geometry-error
(condition).
zero-norm-error
(condition).
l-math/generics.lisp
conditions.lisp
(file).
l-math
(system).
*equivalence-tolerance*
(special variable).
copy
(generic function).
dimension
(generic function).
equivalent
(generic function).
negate
(generic function).
negate!
(generic function).
to-homogenous
(generic function).
to-list
(generic function).
zerop
(generic function).
initialise-data
(generic function).
l-math/vector.lisp
generics.lisp
(file).
l-math
(system).
copy
(method).
copy-vector
(generic function).
dimension
(method).
dimension
(method).
do-each-vector-element
(macro).
(setf elt)
(setf expander).
elt
(generic function).
equivalent
(method).
equivalent
(method).
equivalent
(method).
equivalent
(method).
initialize-instance
(method).
length
(generic function).
make-load-form
(method).
make-vector
(function).
negate
(method).
negate
(method).
negate!
(method).
negate!
(method).
norm
(generic function).
normalise
(generic function).
normalise!
(generic function).
print-object
(method).
to-homogenous
(method).
to-homogenous
(method).
to-list
(method).
to-vector
(generic function).
vector
(function).
vector
(class).
vector=
(generic function).
w
(generic function).
(setf w)
(generic function).
x
(generic function).
(setf x)
(generic function).
y
(generic function).
(setf y)
(generic function).
z
(generic function).
(setf z)
(generic function).
zerop
(method).
zerop
(method).
initialise-data
(method).
l-math/matrix.lisp
vector.lisp
(file).
l-math
(system).
copy
(method).
dimension
(method).
do-each-matrix-element
(macro).
do-each-matrix-element-2
(macro).
equivalent
(method).
initialize-instance
(method).
make-diagonal
(function).
make-identity
(function).
make-load-form
(method).
make-matrix
(function).
matrix
(class).
matrix-cols
(generic function).
(setf matrix-elt)
(setf expander).
matrix-elt
(generic function).
matrix-rows
(generic function).
matrix=
(generic function).
negate
(method).
negate!
(method).
print-object
(method).
transpose
(generic function).
zerop
(method).
initialise-data
(method).
l-math/tests.lisp
matrix.lisp
(file).
l-math
(system).
test-dimensions
(generic function).
etest-dimensions
(macro).
etest-needed-vector-dimension
(macro).
test-nonzero
(generic function).
l-math/vector-operations.lisp
tests.lisp
(file).
l-math
(system).
angle-between
(generic function).
centre-of-mass
(generic function).
cross-product
(generic function).
dot-product
(generic function).
euclidean-distance
(generic function).
l-math/operations.lisp
vector-operations.lisp
(file).
l-math
(system).
create-list-operation-method
(macro).
create-vector-operation-method
(macro).
l-math/rotations.lisp
operations.lisp
(file).
l-math
(system).
*rotation-naming-conventions*
(special variable).
create-rotation-from-view
(function).
create-rotation-from-view-to-view
(function).
create-rotation-matrix
(function).
pitch-by
(function).
pitch-matrix
(function).
roll-by
(function).
roll-matrix
(function).
rotation-x
(function).
rotation-y
(function).
rotation-z
(function).
set-rotation-naming-convention
(function).
to-degrees
(function).
to-radians
(function).
yaw-by
(function).
yaw-matrix
(function).
fill-row
(macro).
l-math/scale.lisp
rotations.lisp
(file).
l-math
(system).
create-scale-matrix
(function).
create-uniform-scale-matrix
(function).
l-math/translation.lisp
scale.lisp
(file).
l-math
(system).
create-translation-matrix
(function).
l-math/utility.lisp
translation.lisp
(file).
l-math
(system).
binomial-coefficient
(function).
create-bernstein-polynomial
(function).
evaluate-bernstein-polynomial
(function).
factorial
(function).
l-math/interpolate.lisp
utility.lisp
(file).
l-math
(system).
between
(generic function).
bilinear-interpolation
(generic function).
linear-interpolation
(generic function).
private-bilinear-interpolation
(function).
l-math/random.lisp
interpolate.lisp
(file).
l-math
(system).
draw-noise3-output
(function).
initialize-noise3
(function).
make-random-vector
(function).
noise3
(function).
normal
(function).
uniform
(function).
*perlin-gradients*
(special variable).
*perlin-permutations*
(special variable).
make-random-matrix
(function).
l-math/basis.lisp
random.lisp
(file).
l-math
(system).
all-knots
(generic function).
b-spline-basis
(function).
b-spline-knots
(class).
initialize-instance
(method).
knots
(reader method).
(setf knots)
(writer method).
(setf knots)
(method).
make-knots
(function).
multiplicity
(reader method).
(setf multiplicity)
(writer method).
(setf multiplicity)
(method).
print-object
(method).
calculate-knot-count
(generic function).
calculate-uniformity
(generic function).
centripetal-parameterisation
(function).
chord-length-parameterisation
(function).
find-starting-knot-index
(function).
get-ith-knot
(generic function).
high-parameter
(generic function).
knot-count
(reader method).
low-parameter
(generic function).
make-bezier-basis-matrix
(function).
make-catmull-rom-basis-matrix
(function).
make-hermite-basis-matrix
(function).
make-uniform-nonrational-bspline-basis-matrix
(function).
no-multiplicity-p
(reader method).
number-needed-knots
(function).
ratio-parameterisation
(function).
uniform-p
(reader method).
l-math/spline.lisp
basis.lisp
(file).
l-math
(system).
all-knots
(method).
b-spline
(class).
b-spline-degree
(reader method).
(setf b-spline-degree)
(writer method).
b-spline-knots
(reader method).
(setf b-spline-knots)
(writer method).
b-spline-points
(reader method).
(setf b-spline-points)
(writer method).
basis-matrix
(reader method).
(setf basis-matrix)
(writer method).
bezier-curve
(class).
catmull-rom-spline
(class).
coefficient-matrix
(generic function).
cubic-bezier-curve
(class).
domain-knots
(generic function).
evaluate
(generic function).
hermite-curve
(class).
initialize-instance
(method).
initialize-instance
(method).
maximum-parameter
(generic function).
minimum-parameter
(generic function).
print-object
(method).
set-spline-geometry
(generic function).
spline
(class).
(setf spline-geometry)
(setf expander).
spline-geometry
(generic function).
unrbs-spline
(class).
bernstein-polynomials
(reader method).
bezier-curve-degree
(reader method).
(setf bezier-curve-degree)
(writer method).
(setf bezier-curve-degree)
(method).
get-ith-knot
(method).
last-shared-spline
(class).
matrix-spline
(class).
three-shared-spline
(class).
l-math/spline-interpolation.lisp
spline.lisp
(file).
l-math
(system).
spline-interpolation
(generic function).
l-math/transform.lisp
spline-interpolation.lisp
(file).
l-math
(system).
summation-transformer
(function).
transform
(generic function).
Packages are listed by definition order.
l-math
lm
common-lisp
.
*
(function).
*equivalence-tolerance*
(special variable).
*rotation-naming-conventions*
(special variable).
+
(function).
-
(function).
/
(function).
all-knots
(generic function).
angle-between
(generic function).
b-spline
(class).
b-spline-basis
(function).
b-spline-degree
(generic reader).
(setf b-spline-degree)
(generic writer).
b-spline-knots
(generic reader).
(setf b-spline-knots)
(generic writer).
b-spline-knots
(class).
b-spline-points
(generic reader).
(setf b-spline-points)
(generic writer).
basis-matrix
(generic reader).
(setf basis-matrix)
(generic writer).
between
(generic function).
bezier-curve
(class).
bilinear-interpolation
(generic function).
binomial-coefficient
(function).
c*
(generic function).
c+
(generic function).
c-
(generic function).
c/
(generic function).
catmull-rom-spline
(class).
centre-of-mass
(generic function).
coefficient-matrix
(generic function).
copy
(generic function).
copy-vector
(generic function).
create-bernstein-polynomial
(function).
create-rotation-from-view
(function).
create-rotation-from-view-to-view
(function).
create-rotation-matrix
(function).
create-scale-matrix
(function).
create-translation-matrix
(function).
create-uniform-scale-matrix
(function).
cross-product
(generic function).
cubic-bezier-curve
(class).
dimension
(generic function).
dimension-error
(condition).
do-each-matrix-element
(macro).
do-each-matrix-element-2
(macro).
do-each-vector-element
(macro).
domain-knots
(generic function).
dot-product
(generic function).
draw-noise3-output
(function).
(setf elt)
(setf expander).
elt
(generic function).
equivalent
(generic function).
euclidean-distance
(generic function).
evaluate
(generic function).
evaluate-bernstein-polynomial
(function).
factorial
(function).
hermite-curve
(class).
initialize-noise3
(function).
knots
(generic reader).
(setf knots)
(generic function).
l-math-error
(condition).
length
(generic function).
linear-interpolation
(generic function).
make-diagonal
(function).
make-identity
(function).
make-knots
(function).
make-matrix
(function).
make-random-vector
(function).
make-vector
(function).
matrix
(class).
matrix-cols
(generic function).
(setf matrix-elt)
(setf expander).
matrix-elt
(generic function).
matrix-rows
(generic function).
matrix=
(generic function).
maximum-parameter
(generic function).
minimum-parameter
(generic function).
multiplicity
(generic reader).
(setf multiplicity)
(generic function).
negate
(generic function).
negate!
(generic function).
noise3
(function).
norm
(generic function).
normal
(function).
normalise
(generic function).
normalise!
(generic function).
pitch-by
(function).
pitch-matrix
(function).
roll-by
(function).
roll-matrix
(function).
rotation-x
(function).
rotation-y
(function).
rotation-z
(function).
set-rotation-naming-convention
(function).
set-spline-geometry
(generic function).
spline
(class).
(setf spline-geometry)
(setf expander).
spline-geometry
(generic function).
spline-interpolation
(generic function).
summation-transformer
(function).
test-dimensions
(generic function).
to-degrees
(function).
to-homogenous
(generic function).
to-list
(generic function).
to-radians
(function).
to-vector
(generic function).
transform
(generic function).
transpose
(generic function).
uniform
(function).
unrbs-spline
(class).
vector
(function).
vector
(class).
vector=
(generic function).
w
(generic function).
(setf w)
(generic function).
x
(generic function).
(setf x)
(generic function).
y
(generic function).
(setf y)
(generic function).
yaw-by
(function).
yaw-matrix
(function).
z
(generic function).
(setf z)
(generic function).
zerop
(generic function).
*perlin-gradients*
(special variable).
*perlin-permutations*
(special variable).
bernstein-polynomials
(generic reader).
bezier-curve-degree
(generic reader).
(setf bezier-curve-degree)
(generic function).
calculate-knot-count
(generic function).
calculate-uniformity
(generic function).
centripetal-parameterisation
(function).
chord-length-parameterisation
(function).
create-list-operation-method
(macro).
create-vector-operation-method
(macro).
dimension-error-dim1
(generic reader).
dimension-error-dim2
(generic reader).
etest-dimensions
(macro).
etest-needed-vector-dimension
(macro).
fill-row
(macro).
find-starting-knot-index
(function).
get-ith-knot
(generic function).
high-parameter
(generic function).
initialise-data
(generic function).
knot-count
(generic reader).
l-math-error-format-arguments
(generic reader).
l-math-error-format-control
(generic reader).
last-shared-spline
(class).
low-parameter
(generic function).
make-bezier-basis-matrix
(function).
make-catmull-rom-basis-matrix
(function).
make-hermite-basis-matrix
(function).
make-random-matrix
(function).
make-uniform-nonrational-bspline-basis-matrix
(function).
matrix-spline
(class).
no-multiplicity-p
(generic reader).
number-needed-knots
(function).
operation-not-suported-operation-name
(generic reader).
operation-not-supported
(condition).
operation-not-supported-extra-information
(generic reader).
private-bilinear-interpolation
(function).
ratio-parameterisation
(function).
required-dimension-error
(condition).
spline-geometry-error
(condition).
test-nonzero
(generic function).
three-shared-spline
(class).
uniform-p
(generic reader).
zero-norm-error
(condition).
Definitions are sorted by export status, category, package, and then by lexicographic order.
When objects are closer than this distance, they are considered equivalent.
Defines the various mappings possible between ROLL-MATRIX, PITCH-MATRIX, YAW-MATRIX, and the different axes.
Iterates over each of the matrix elements, row by row.
Iterates over elements in a vector.
matrix-elt
(generic function).
spline-geometry
(generic function).
set-spline-geometry
(generic function).
Ask for the value of a given basis function. This is based on
Farin’s ’Curves and Surfaces for Computer Aided Geometric Design. DEGREE is the degree of the curve.
This has some pre-calculated basis functions for uniform knot
secquences. You can access these by specifying an index using
FAST-SPLINE-INDEX. This is an integer between 0 and DEGREE, and
specifies which of the basis functions should be called.
Calculates the binomial coefficients. n and i must be non-negative.
Returns a bernstein polynomial for n and i. This returned function takes one parameter.
Given a direction to look in (VIEW), and the direction that is ’upwards’ in a given coordinate system, this function creates a rotation matrix to translate into that coordinate system. This matrix should be post multiplied by any vectors. The matrix is defined using a left-handed coordinate system.
Creates a rotation matrix that will rotate the vector FROM-VIEW on to the vector TO-VIEW, using WORLD-UP as the coordinate system’s ’upward’ direction. This matrix should be post-multiplied by any vectors.
Creates a rotation matrix from three vectors. VIEW is the direction that the object should be pointing along, UP is the direction upwards. RIGHT is the vector orthogonal to this.
Given a list of scales, one for each dimension, this returns a matrix that will scale any post multiplied vectors by the appropriate amount in each dimension.
Given a list of translation, this returns a (1+ (length translations)) × (1+ (length translations)) matrix that will translate any post multiplied vector by the given amount in each dimension. This is a matrix that operates in homogenous coordinates.
Creates a matrix that will scale all elements uniformly. Post multiply this matrix by the vectors.
Outputs perlin noise in the PPM format. WIDTH and HEIGHT are the resolution of the image. FILE-PATH defines where the image should be saved, and PLANE-WIDTH defines the width of the plane on which the noise is added. The wider this width, the smaller the noise detail.
Evaluates the bernstein polygnomial for n and i at t-val. If this polynomial will be used multiple times, it might be more efficient to create it using CREATE-BERNSTEIN-POLYNOMIAL.
Calculates the factorial of the integer, n. The factorial is the product of the sequence of integers 1, 2, 3, ..., n. n must not be a negative number. The factorial of n = 0 is defined to be 1.
Initialises the perlin noise function, NOISE3. This will be called automatically by NOISE3 if it has not already been done so. You usually will not have to call this function. If you wish to change the random data which NOISE3 uses to calculate the perlin noise, then call this function. LOOKUP-SIZE determines the amount of data stored to calculate the perlin noise. You will probably not have to change this from the default value.
Creates a (length diagonal) × (length diagonal) matrix zero everywhere except along the diagonal.
Creates an size x size identity matrix.
Creates a knot sequence. Notice that this will add some phantom knots to the beginning and end of the sequence, unless ADD-PHANTOMS is false. If MULTIPLICITY, a list of multiplicity values, is not given, each knot is assumed to be a simple (non-repeated) knot.
Creates a matrix of the given dimensions.
Creates a VECTOR of the given dimension filled with random values obtained by calling NOISE once for each element in the VECTOR. By default, this uses normally distributed random numbers with a mean of 0 and standard deviation of 1.
Create a vector of the given dimensions.
Calculates Perlin noise. As input, it takes a 3-vector. It returns a random value between -1 and 1.
Returns a normally distributed random variable with the given mean and standard-deviation. If min or max is given, the random number is no smaller than min and no larger than max.
Returns the given vector after it has undergone a pitch by the given angle, specified in radians. This is a left-handed rotation.
A synonym for ROTATION-X, although this can be changed using lm:SET-ROTATION-NAMING-CONVENTION.
Returns the given vector after it has undergone a roll by the given angle, specified in radians. This is a left-handed rotation.
A synonym for ROTATION-Z, although this can be changed using lm:SET-ROTATION-NAMING-CONVENTION.
Creates a matrix that rotates around the x-axis by the given angle, given in radians. This is a left-handed rotation.
Creates a matrix that rotates around the y-axis by the given angle, given in radians. This is a left-handed rotation
Creates a matrix that rotates around the z-axis by the given angle, in radians. This is a left-handed rotation.
Changes the mappings between ROLL-MATRIX, PITCH-MATRIX and YAW-MATRIX and the axes. See lm:*rotation-naming-conventions* to see what conventions are possible.
Returns a function that will add the additive-term, and all the other-terms, to its argument. It is useful for translating objects, since that is merely an addition of a vector term.
Returns a random number uniformly distributed between
minimum (inclusive) and maximum (exclusive). Like CL:RANDOM, the type
of the returned value depends on the type of min and max.
Create a vector.
Returns the given vector after it has undergone a yaw by the given angle, specified in radians. This is a left-handed rotation.
A synonym for ROTATION-Y, although this can be changed using lm:SET-ROTATION-NAMING-CONVENTION.
Given a knots data structure, this will return a list of all knots, including multiplicities.
b-spline
)) ¶Returns a list of all the knots (repeated if necessary for multiplicity) of the b-spline
b-spline-knots
)) ¶Returns the angle between two vectors. The angle is
in radians, and is signed. The angle represents the the angle needed
to transform the FROM vector to the TO vector.
matrix-spline
)) ¶matrix-spline
)) ¶Defines the behaviour of the
spline. For possible bases to use, see
MAKE-HERMITE-BASIS-MATRIX, MAKE-BEZIER-BASIS-MATRIX,
and MAKE-UNIFORM-NONRATIONAL-BSPLINE-BASIS-MATRIX
Calculates the vector half way between two other
vectors. This is equivalent to (LINEAR-INTERPOLATION START END
0.5).
Performs bilinear interpolation: first this
performs linear interpolation between the TOP-LEFT and BOTTOM-LEFT,
as well as TOP-RIGHT and BOTTOM-RIGHT, using the y coordinate of the
parameter. It then performs linear interpolation between these
obtained values using the parameter’s x coordinate. The four
position vectors can be of any dimension, but must all be of the
same dimension. The paramater must be a 2-vector. Parameter
(0, 0) maps to the upper left corner, and (1, 1) maps to the lower
right corner.
multiplies two objects together.
list
) rhs) ¶Converts lists to vectors when performing mixed type operations.
list
)) ¶Converts lists to vectors when performing mixed type operations.
list
) (rhs list
)) ¶number
) (rhs number
)) ¶number
) (rhs list
)) ¶list
) (rhs number
)) ¶Adds two objects together.
list
) rhs) ¶Converts lists to vectors when performing mixed type operations.
list
)) ¶Converts lists to vectors when performing mixed type operations.
list
) (rhs list
)) ¶number
) (rhs number
)) ¶number
) (rhs list
)) ¶list
) (rhs number
)) ¶Subtracts objects.
list
) rhs) ¶Converts lists to vectors when performing mixed type operations.
list
)) ¶Converts lists to vectors when performing mixed type operations.
list
) (rhs list
)) ¶number
) (rhs number
)) ¶number
) (rhs list
)) ¶list
) (rhs number
)) ¶Divides two objects.
list
) rhs) ¶Converts lists to vectors when performing mixed type operations.
list
)) ¶Converts lists to vectors when performing mixed type operations.
list
) (rhs list
)) ¶number
) (rhs number
)) ¶number
) (rhs list
)) ¶list
) (rhs number
)) ¶Calculates the centre point of a series of objects.
number
) &rest numbers) ¶Calculates the average of a list of numbers.
Returns a list of coefficient matrices for the
polynomials that control the curve along each segment. The first
column of each matrix contains the coefficients for the polynomial
calculating the x coefficients (row 1 is the cubic coefficient, row
2 the quadratic coefficient, row 3 the linear coefficient, and row 4
the constant). Column 2 does the same for the y polynomial
coefficients, and column 3 for the z coefficients.
matrix-spline
)) ¶Returns a copy of the given item.
Returns a copy of the original vector
Calculates the cross product between 3-vectors
Returns the dimensions of a given object.
matrix
)) ¶Returns a list giving the number of rows and columns in the matrix.
list
)) ¶Returns the dimension of a vector represented as a list.
Returns a list of the domain knots of the
spline (the knots over which the spline is defined). These are
repeated for multiplicities.
Calculates the dot product between two vectors.
Returns the element of a VECTOR at the given index.
list
) (index integer
)) ¶Returns t iff the two objects are numerically the same. Real valued objects are always compared using *equivalence-tolerance*.
list
) (rhs list
)) ¶Returns t iff the two lists are of the same length with equivalent elements.
A default implementation that ensures that unrelated objects are not considered equivalent.
number
) (rhs number
)) ¶Returns t iff two numbers are equivalent (using =).
real
) (rhs real
)) ¶Two real values are compared for equivalence to a pre-defined tolerance.
Calculates the Euclidean distance between two objects.
Evaluate the given spline at the given parameter value. Returns a point on that spline.
bezier-curve
) (t-val real
)) ¶Evaluates the given bezier curve at the given parameter value.
matrix-spline
) (parameter real
)) ¶Evaluates the given spline at the parameter.
b-spline-knots
)) ¶An ascending collection of knots, stored with repetition.
b-spline-knots
)) ¶b-spline-knots
)) ¶An ascending collection of knots, stored with repetition.
An alias for DIMENSION
Interpolates between two points, using the
parametric line equation. START and END are the two endpoints of a
line. While T-VAL takes values between 0 and 1, inclusive, the
returned points will lie between these two points. No matter the
value of T-VAL, the returned point will always be on the line, but
will be outside of the [start, end] line segment if T-VAL is not on
the domain [0, 1]
Returns the number of columns in a matrix.
Return the matrix componenent at the given row and column
Return the number of rows in a matrix.
Returns t iff the two matrices are equal. Effected by *equivalence-tolerance*.
Returns the maximum value that the spline parameter may take.
bezier-curve
)) ¶matrix-spline
)) ¶Returns the minimum value that the spline parameter may take.
bezier-curve
)) ¶matrix-spline
)) ¶b-spline-knots
)) ¶The multiplicity of the above knots.
b-spline-knots
)) ¶b-spline-knots
)) ¶The multiplicity of the above knots.
Returns an item with all of its elements negated. This is non-destructive.
list
)) ¶Non-destructively returns the additive inverse of the list, as if it were a vector.
vector
)) ¶Non-destructively returns the additive inverse of a vector.
number
)) ¶Returns the additive inverse of all basic Common Lisp numbers. This is just a shortcut for using the cl:- function.
Returns the additive inverse of an item, much like NEGATE, only this version is destructive.
list
)) ¶Destructively returns the additive inverse of the given list.
The distance of the vector from zero.
list
)) ¶Returns a normalised version of the vector.
list
)) ¶Returns the normalised version of a vector represented as a list.
Destructively normalises the vector.
list
)) ¶Destructively updates the vector, represented as a list, into its normalised version.
Set the control geometry (end points, tangents, etc.) of the given spline.
b-spline
) (geometry list
)) ¶A list of points defining the spline’s b-spline polygon.
bezier-curve
) (geometry list
)) ¶A list of points defining the bézier curve’s geometry. For a curve of degree n, there should be n+1 points.
three-shared-spline
) (list list
)) ¶A list of points making up the spline geometry, in order of occurance.
last-shared-spline
) (list list
)) ¶Sets the control geometry of the hermite curve and bézier
curves.
For hermite curves, this list should contain at least 4
elements, and should be laid out in the following manner, where Pn
represents the nth point, and a(Pn) represents the tangent leading
away from that point, and b(Pn) represents the tangent leading
towards that point.
P1 a(P1) b(P2) P2 a(P2) b(P3) P3 a(P3) ... b(Pn-1) Pn-1 a(Pn-1) b(Pn) Pn
For bézier curves, this should be a sequence of control points:
P1 P2 P3 P4 P5 ... Pn
Both the points and the tangents should be 3-vectors.
Returns the geometry of the associated
spline. These are the end points, tangents, and so on, of the
various splines.
bezier-curve
)) ¶three-shared-spline
)) ¶Returns the list of geometry making up the spline.
last-shared-spline
)) ¶Returns a list of the geometry that made up the spline.
Returns a b-spline that interpolates the given
points. This is based on the discussion in sections 9.1 and 7.8 of
Farin’s Curves and Surfaces for Computer Aided Geometric
Design. PARAMETRISATION should be one of :uniform, :centripetal,
or :chord-length. If CLOSE is true, then this will produce a closed
b-spline.
list
) &key degree parametrisation close) ¶Throws an error if the two objects do not agree in
dimensions. If the second object is a matrix, it is possible to
transpose the dimensions that are tested using the :transpose-rhs
argument.
list
) (dimension number
) &key) ¶Ensure that the given vector has the specified dimension.
list
) (rhs list
) &key) ¶Takes an item and lifts it into homogenous space by adding one dimension on to it.
Returns a representation of the given object as a list.
Returns a new vector object based created from the
function’s arguments. If dimension is supplied, it should be a
positive integer defining the dimension of the returned vector. If
the specified dimension is shorter than the given item, extra
elements are truncated. If it is longer, the new vector will be
padded with zero elements.
list
) &key dimension) ¶Converts a list to a vector.
Applies the transformer to the object, and returns the appropriate result of the transformation.
b-spline
)) ¶Transforms a spline. The TRANSFORMER should accept a point, and will be called once for each control point of the spline. The new spline will share the B-SPLINE-KNOTS of the old spline object.
function
) (vector vector
)) ¶Applies a function to a vector and returns the result.
list
)) ¶Applies the transformer to all objects in a list, returning the list of results, much like MAPCAR.
Returns the non-destructive transpose of a matrix
Returns t iff the two vectors are equal. Effected by *equivalence-tolerance*.
Returns the w component from an appropriately sized vector.
Sets the w component from an appropriately sized vector.
Returns the x component from an appropriately sized vector.
list
)) ¶Allows a list to be treated accessed in a limited way as a vector.
Sets the x component from an appropriately sized vector.
list
)) ¶Returns the y component from an appropriately sized vector.
list
)) ¶Allows a list to be accessed, in a limited way, as a vector.
Sets the y component from an appropriately sized vector.
list
)) ¶Returns the z component from an appropriately sized vector.
list
)) ¶Allows a list to be accessed, in a limited way, as a vector.
Sets the z component from an appropriately sized vector.
list
)) ¶Returns T iff the given item is zero, to the tolerance used by EQUIVALENT
matrix
)) ¶Returns T iff all components in the matrix is EQUIVALENT to zero.
list
)) ¶Returns T if all components of the vector are zero.
number
)) ¶bezier-curve
) &key degree) ¶b-spline-knots
) &key) ¶b-spline
) &key uniform chord-length centripetal) ¶UNIFORM: if true, will automatically create a set of uniform knots, based on the b-spline’s degree and number of points in the b-spline polygon.
b-spline-knots
) stream) ¶error
.
(quote "a general mathematical error has occured.")
:format-control
This slot is read-only.
(quote nil)
:format-arguments
This slot is read-only.
A non-uniform b-spline implementation. It has much
code to speed up the uniform quadratic and cubic cases, however. But
it supports arbitrary degree non-uniform b-splines in an arbtirary
n-dimensional space.
There are a number of options when constructing a b-spline. The
simplest is when constructing a uniform b-spline, like so:
(make-instance ’lm:b-spline :degree 3 :points *list-of-points* :uniform t)
A non-uniform parameterisation that attempts to equalise the
distance travelled over parameter sections is chord length parameterisation:
(make-instance ’lm:b-spline :degree 3 :points *list-of-points* :chord-length t)
Another non-uniform parameterisation (the prefered parametrisation)
is centripetal parametrisation, which preserves ratios of square
roots of distances between points of the control geometry:
(make-instance ’lm:b-spline :degree 3 :points *list-of-points* :centripetal t)
Knots may be specified with the :knots argument, and should be
constructed using lm:MAKE-KNOTS.
A list of points used defining the b-spline polygon.
list
:points
A structure detailing the spline’s knots.
(or null l-math:b-spline-knots)
:knots
The degree of the b-spline. This defaults to cubic.
integer
3
:degree
Some docs. You will likely find it more convenient
to construct instance of this class using MAKE-KNOTS. Notice that
B-SPLINE-BASIS requires a phantom knot on either end of the knot
sequence. MAKE-KNOTS will automatically add those knots for you.
An ascending collection of knots, stored with repetition.
(or null (simple-array double-float))
:knots
The multiplicity of the above knots.
(or null (simple-array fixnum))
:multiplicity
The number of knots, taking in to account multiplicity.
fixnum
0
This slot is read-only.
Indicates whether there is a multiplicity or not in the knots.
This slot is read-only.
A general bezier curve class, which can be of any
degree (unlike CUBIC-BEZIER-CURVE, which is always cubic). Note that
this is a single curve, and not a piecewise spline. If you want a
piecewise generalisation of this, use the B-SPLINE class.
The degree of the curve. The default is to be cubic.
integer
A cached list of berstein-polynomials, used in the calculation of the curve.
list
This slot is read-only.
A list of points defining the
curve. For a cubic curve, that is 4 points. For a
curve of degree n, there will be n+1 points.
:spline-geometry
The interpolating catmull-rom spline in 3-space. This spline passes through all of its control points. It is also called the Overhauser spine.
Initarg | Value |
---|---|
:basis-matrix | (make-catmull-rom-basis-matrix) |
Represents a cubic bézier curve in 3-space.
Initarg | Value |
---|---|
:basis-matrix | (make-bezier-basis-matrix) |
Represents a hermite curve in 3-space.
Initarg | Value |
---|---|
:basis-matrix | (make-hermite-basis-matrix) |
A mathematical matrix class.
c*
.
c*
.
c*
.
c*
.
c*
.
c+
.
c+
.
c-
.
c-
.
c/
.
c/
.
copy
.
dimension
.
equivalent
.
initialise-data
.
initialize-instance
.
make-load-form
.
matrix-cols
.
matrix-elt
.
matrix-rows
.
matrix=
.
negate
.
negate!
.
print-object
.
test-dimensions
.
test-dimensions
.
test-dimensions
.
test-dimensions
.
test-dimensions
.
transpose
.
zerop
.
A 2D array holding the matrix data.
(array double-float)
:data
A base class for all spline and parametric curve implementations.
A uniform, non-rational b-spline in 3-space.
Initarg | Value |
---|---|
:basis-matrix | (make-uniform-nonrational-bspline-basis-matrix) |
A mathematical vector class.
angle-between
.
bilinear-interpolation
.
c*
.
c*
.
c*
.
c*
.
c*
.
c+
.
c+
.
c+
.
c-
.
c-
.
c-
.
c/
.
c/
.
c/
.
centre-of-mass
.
copy
.
copy-vector
.
cross-product
.
dimension
.
dot-product
.
dot-product
.
dot-product
.
elt
.
equivalent
.
equivalent
.
equivalent
.
euclidean-distance
.
initialise-data
.
initialize-instance
.
make-load-form
.
negate
.
negate!
.
norm
.
normalise
.
normalise!
.
print-object
.
test-dimensions
.
test-dimensions
.
test-dimensions
.
test-dimensions
.
to-homogenous
.
to-list
.
to-vector
.
transform
.
vector=
.
(setf w)
.
w
.
(setf x)
.
x
.
(setf y)
.
y
.
(setf z)
.
z
.
zerop
.
An array holding the vector’s data
(array double-float)
:data
Stores the wavelet coefficients / gradients.
A list of random permutations.
Generates a method, such as c+, which operates on common lisp lists, treating them as if they were vectors.
Expands into code that can be used to fill out one a method for one of the generic methods defined below, such as c+
A macro useful for filling matrices in functions such as CREATE-ROTATION-MATRIX.
Produces a non-parameteric parameterisation for b-splines, where the ratio of parameters is equivalent to the square root of the ratio of the distances between the corresponding control points.
Produces a non-parameteric parameterisation for b-splines, where the ratio of parameters is equivalent to the ratio of the distances between the corresponding control points.
Given knot data, the degree of a spline, and a parameter, this locates the first index of the knots which will be used to define the point on the given spline. Returns first the b-spline-basis family to be used, and then the offset index of the knot.
Returns the 4×4 Bézier basis matrix.
Returns the 4×4 matrix for catmull-rom interpolating splines.
Returns the 4×4 hermite basis matrix.
Creates a MATRIX of the ROWS × COLS dimension filled with random values obtained by calling NOISE once for each element in the MATRIX. By default, this uses normally distributed random numbers with a mean of 0 and standard deviation of 1.
Returns a 4×4 matrix for the uniform, nonrational b-splines.
Given the number of points making up a spline, and the degree of the spline, this will tell us the number of required knots.
This can be used to determine a knot sequence based on some ’distance’ between the given points. The distance is measured using FUNCTION, which should be a binary function returning a real. If this function is the euclidean distance metric, then this will produce chord-length parametrisation.
bezier-curve
)) ¶A cached list of berstein-polynomials, used in the calculation of the curve.
bezier-curve
)) ¶The degree of the curve. The default is to be cubic.
bezier-curve
)) ¶bezier-curve
)) ¶The degree of the curve. The default is to be cubic.
Returns the number of knots in the data, taking in to account multiplicity. Sets KNOT-COUNT accordingly.
b-spline-knots
)) ¶Calculates whether the knot-data is uniform or not. Sets UNIFORM-P accordingly.
b-spline-knots
)) ¶required-dimension-error
)) ¶dim1
.
dimension-error
)) ¶dim1
.
required-dimension-error
)) ¶dim2
.
dimension-error
)) ¶dim2
.
Returns the ith knot, taking in to account
multiplicity. OFFSET should be positive number that array indices
are offset by.
b-spline-knots
) (i integer
) &optional offset) ¶Given a knot sequence and the degree of the spline,
this returns the highest possible parameter value the spline will
aceept.
b-spline-knots
) (degree integer
)) ¶Initialises the DATA slot to the given size. Returns the vector object.
b-spline-knots
)) ¶The number of knots, taking in to account multiplicity.
l-math-error
)) ¶l-math-error
)) ¶Given a knot sequence and the degree of the spline,
this returns the lowest possible parameter value the spline will
accept.
b-spline-knots
) (degree integer
)) ¶b-spline-knots
)) ¶Indicates whether there is a multiplicity or not in the knots.
operation-not-supported
)) ¶operation-not-supported
)) ¶Throws a ZERO-LENGTH-ERROR if the given vector has a length close to zero.
b-spline-knots
)) ¶A boolean indicating whether this is a uniform sequence of knots or not.
(quote "<generic operation>")
:operation-name
This slot is read-only.
(quote nil)
:extra-information
This slot is read-only.
(quote "the geometry data for the spline is malformed.")
:format-control
(quote "the given vector is of zero length.")
:format-control
This class is for those curves / splines who set up
their geometry matrices by repeating the last element in a set of
four, such as the hermite and bézier curves.
Used to represent splines that are defined by basis matrices.
Defines the behaviour of the
spline. For possible bases to use, see
MAKE-HERMITE-BASIS-MATRIX, MAKE-BEZIER-BASIS-MATRIX,
and MAKE-UNIFORM-NONRATIONAL-BSPLINE-BASIS-MATRIX
:basis-matrix
An array storing the various geometry matrices that make up the spline.
(or null simple-array)
Represents those splines for which the last three
geometry points are always shared with a new point to construct the
spline. These are splines such as the b-splines and catmull-rom
splines.
Jump to: | (
*
+
-
/
A B C D E F G H I K L M N O P R S T U V W X Y Z |
---|
Jump to: | (
*
+
-
/
A B C D E F G H I K L M N O P R S T U V W X Y Z |
---|
Jump to: | *
B D E F G K M N O P S U |
---|
Jump to: | *
B D E F G K M N O P S U |
---|
Jump to: | B C D F G H I L M O P R S T U V Z |
---|
Jump to: | B C D F G H I L M O P R S T U V Z |
---|