This namespace defines a functional API for:
Rn
and manifolds
specialized to a concrete dimension)As well as a whole bunch of defined manifolds and coordinate systems for exploration and fun!
This namespace defines a functional API for: - differentiable manifolds (both manifold families like [[Rn]] and manifolds specialized to a concrete dimension) - manifold points - coordinate patches As well as a whole bunch of defined manifolds and coordinate systems for exploration and fun!
(attach-coordinate-system family
coordinate-system-name
patch-name
coordinate-system-ctor)
Returns a new manifold family generated by attaching the supplied coordinate
system constructor to family
, indexed by the supplied patch and coordinate
system names.
Returns a new manifold family generated by attaching the supplied coordinate system constructor to `family`, indexed by the supplied patch and coordinate system names.
(attach-patch family patch-name)
Takes a manifold family
and attaches a patch template with the supplied
patch-name
. Returns a new manifold family.
All manifolds generated from the returned family will have this coordinate patch attached.
Takes a manifold `family` and attaches a patch template with the supplied `patch-name`. Returns a new manifold family. All manifolds generated from the returned family will have this coordinate patch attached.
(c:generate n orientation f)
Generates a coordinate structure of the supplied dimension n
, and
orientation
using the supplied function f
for entries. See the very
similar emmy.structure/generate
for more details.
NOTE from GJS: this is a kludge introduced only to allow a coordinate of dimension 1 to automatically unwrap itself.
Generates a coordinate structure of the supplied dimension `n`, and `orientation` using the supplied function `f` for entries. See the very similar [[emmy.structure/generate]] for more details. NOTE from GJS: this is a kludge introduced only to allow a coordinate of dimension 1 to automatically unwrap itself.
(chart coordinate-system)
Given an ICoordinateSystem
, returns a function from a point on the
coordinate system's manifold to the coordinate representation specified by the
supplied coordinate-system
.
Given an [[ICoordinateSystem]], returns a function from a point on the coordinate system's manifold to the coordinate representation specified by the supplied `coordinate-system`.
(constant-manifold-function c)
Takes some constant c
and returns a manifold function that maps every input
manifold point
to c.
Takes some constant `c` and returns a manifold function that maps every input manifold `point` to `c.`
(coordinate-prototype coordsys)
Returns the symbolic coordinate prototype associated with coordsys
. This is
a structure of the correct dimension for this coordinate system, with all
symbolic entries.
Returns nil for non-valid inputs.
Returns the symbolic coordinate prototype associated with `coordsys`. This is a structure of the correct dimension for this coordinate system, with all symbolic entries. Returns nil for non-valid inputs.
(coordinate-system-at manifold coordinate-system-name patch-name)
Returns an ICoordinateSystem
instance specialized to the patch named
patch-name
on manifold
.
Returns an [[ICoordinateSystem]] instance specialized to the patch named `patch-name` on `manifold`.
(coordinate-system-names patch)
Returns a set of names of all coordinate system constructors registered in the supplied patch.
Returns a set of names of all coordinate system constructors registered in the supplied patch.
(coordinate-system? x)
Returns true if x
implements ICoordinateSystem
, false otherwise.
Returns true if `x` implements [[ICoordinateSystem]], false otherwise.
(corresponding-velocities coords)
Takes a coordinate representation coords
of a manifold point with all
symbolic entries, and returns a structure of the same shape with v:
prepended to all symbols.
This structure is appropriate for representing the velocities associated with each coordinate.
Takes a coordinate representation `coords` of a manifold point with all symbolic entries, and returns a structure of the same shape with `v:` prepended to all symbols. This structure is appropriate for representing the velocities associated with each coordinate.
(get-coordinates manifold-point coordinate-system thunk)
Returns the representation of manifold-point
in coordinate-system
.
If an entry for the given coordinate-system
is not found, thunk
is called
to produce the representation. The representation is cached in the point.
Returns the representation of `manifold-point` in `coordinate-system`. If an entry for the given `coordinate-system` is not found, `thunk` is called to produce the representation. The representation is cached in the point.
(get-patch manifold patch-name)
Returns the patch named by patch-name
within the supplied manifold
if
registered. Throws otherwise.
NOTE that the returned patch will keep a reference to the supplied manifold
under a :manifold
key.
A coordinate patch is a simply-connected open set around a point in the manifold. A manifold might have many patches. Coordinate systems are defined on patches; these allow the parameterization of any point on the patch in terms of a tuple of real numbers (the coordinates).
Returns the patch named by `patch-name` within the supplied `manifold` if registered. Throws otherwise. NOTE that the returned patch will keep a reference to the supplied `manifold` under a `:manifold` key. A coordinate patch is a simply-connected open set around a point in the manifold. A manifold might have many patches. Coordinate systems are defined on patches; these allow the parameterization of any point on the patch in terms of a tuple of real numbers (the coordinates).
(check-coordinates this coords)
Returns true if the supplied coordinates coords
can be converted into a
point by this ICoordinateSystem
, false otherwise.
Returns true if the supplied coordinates `coords` can be converted into a point by this [[ICoordinateSystem]], false otherwise.
(check-point this point)
Returns true if the supplied point
can be converted into coordinates by
this ICoordinateSystem
, false otherwise.
Returns true if the supplied `point` can be converted into coordinates by this [[ICoordinateSystem]], false otherwise.
(coords->point this coords)
Returns the manifold point on this ICoordinateSystem
's manifold
corresponding to the supplied coords
.
Returns the manifold point on this [[ICoordinateSystem]]'s manifold corresponding to the supplied `coords`.
(point->coords this point)
Returns a coordinate representation of the supplied manifold point point
,
as specified by this ICoordinateSystem
.
Returns a coordinate representation of the supplied manifold point `point`, as specified by this [[ICoordinateSystem]].
(uuid this)
Returns a unique identifier for this instance of ICoordinateSystem
.
(This is an internal implementation detail to allow us to attach coordinate
prototypes and other items as metadata to an ICoordinateSystem
without
affecting equality.)
Returns a unique identifier for this instance of [[ICoordinateSystem]]. (This is an internal implementation detail to allow us to attach coordinate prototypes and other items as metadata to an [[ICoordinateSystem]] without affecting equality.)
(literal-manifold-function sym coordinate-system)
Given a symbolic name sym
and an ICoordinateSystem
, returns a literal
function that maps coordinate-free manifold points to a scalar output.
Also aliased as literal-manifold-function
.
Given a symbolic name `sym` and an [[ICoordinateSystem]], returns a literal function that maps coordinate-free manifold points to a scalar output. Also aliased as [[literal-manifold-function]].
Alias for literal-manifold-function
, present for scmutils
codebase compatibility.
Alias for [[literal-manifold-function]], present for scmutils codebase compatibility.
(make-manifold family n)
(make-manifold family n embedding-dimension)
Returns a concrete manifold generated by specializing the supplied manifold
family
into a concrete manifold of dimension n
. n
must be a positive
integer.
Optionally takes an embedding-dimension
; this must be >= the value of n
.
Use this in cases like an n-sphere embedded in a euclidean space of dimension
n+1.
A manifold is a topological space that locally resembles Euclidean space near each point.
Returns a concrete manifold generated by specializing the supplied manifold `family` into a concrete manifold of dimension `n`. `n` must be a positive integer. Optionally takes an `embedding-dimension`; this must be >= the value of `n`. Use this in cases like an n-sphere embedded in a euclidean space of dimension n+1. A [manifold](https://en.wikipedia.org/wiki/Manifold) is a topological space that locally resembles Euclidean space near each point.
(make-manifold-family name-format)
(make-manifold-family name-format over)
Generates a manifold family (a template for building manifolds) from the
supplied name-format
.
Generated manifolds locally resemble Euclidean space (Rn) by default. You can
optionally pass 'Complex
or 'Quaternion
to over
to customize the field
of the vector space that the manifold locally resembles at each point.
NOTE: only 'Real
does anything as of 3.15.2021.
Generates a manifold family (a template for building manifolds) from the supplied `name-format`. Generated manifolds locally resemble Euclidean space (Rn) by default. You can optionally pass `'Complex` or `'Quaternion` to `over` to customize the field of the vector space that the manifold locally resembles at each point. NOTE: only `'Real` does anything as of 3.15.2021.
(manifold m)
If m
is a manifold, acts as identity. Else, if given some structure
associated with a manifold (like a coordinate system), returns the associated
manifold.
If `m` is a manifold, acts as identity. Else, if given some structure associated with a manifold (like a coordinate system), returns the associated manifold.
(manifold-family? m)
Returns true
if m
is a dictionary representing a manifold family, false
otherwise.
Returns `true` if `m` is a dictionary representing a manifold family, false otherwise.
(manifold-point-representation point)
Returns the backing Euclidean space representation of the supplied manifold point.
Returns the backing Euclidean space representation of the supplied manifold point.
(manifold-point? p)
Returns true if p
is a manifold point, false otherwise.
Returns true if `p` is a manifold point, false otherwise.
(manifold-type manifold)
The supplied manifold m
locally resembles some vector space; this function
returns the field over which that vector space was specified.
The supplied manifold `m` locally resembles some vector space; this function returns the field over which that vector space was specified.
(manifold? m)
Returns true
if m
is a dictionary representing a manifold, false
otherwise.
Returns `true` if `m` is a dictionary representing a manifold, false otherwise.
(one-manifold-function point)
Manifold function that maps every input manifold point
to the scalar value 1.
Manifold function that maps every input manifold `point` to the scalar value 1.
(patch-names manifold)
Returns a set of patch names registered in the supplied manifold.
Returns a set of patch names registered in the supplied manifold.
(point coordinate-system)
Given an ICoordinateSystem
, returns a function from coordinates in
coordinate-system
's repesentation to the matching point on the manifold
associated with coordinate-system
.
Given an [[ICoordinateSystem]], returns a function from coordinates in `coordinate-system`'s repesentation to the matching point on the manifold associated with `coordinate-system`.
(point->manifold point)
Return the manifold upon which this point
was defined.
Return the manifold upon which this `point` was defined.
Similar to the S2-spherical
coordinate system, with the north pole rotated
90 degrees and lying along the positive y axis.
Similar to the [[S2-spherical]] coordinate system, with the north pole rotated 90 degrees and lying along the positive y axis.
(transfer-point embedded embedding)
Returns a function that takes a single manifold point
embedded in the
manifold embedded
and transfers the point to the supplied embedding
manifold.
The embedding dimension must be the same for both manifolds.
NOTE that embedded
and embedding
can be either manifolds, or instances
of ICoordinateSystem
. In the latter case embedded
and embedding
will
bind to the manifold associated with the supplied ICoordinateSystem
.
Returns a function that takes a single manifold `point` embedded in the manifold `embedded` and transfers the point to the supplied `embedding` manifold. The embedding dimension must be the same for both manifolds. NOTE that `embedded` and `embedding` can be either manifolds, or instances of [[ICoordinateSystem]]. In the latter case `embedded` and `embedding` will bind to the manifold associated with the supplied [[ICoordinateSystem]].
(typical-coords coordinate-system)
Given an ICoordinateSystem
, returns a structure that matches
the coordinate-prototype
of coordinate-system
, with all unique,
gensym-ed entries.
Use typical-coords
if you require a unique symbolic coordinate
representation compatible with coordinate-system
.
See typical-point
for a coordinate-free version of this function.
Given an [[ICoordinateSystem]], returns a structure that matches the [[coordinate-prototype]] of `coordinate-system`, with all unique, gensym-ed entries. Use [[typical-coords]] if you require a unique symbolic coordinate representation compatible with `coordinate-system`. See [[typical-point]] for a coordinate-free version of this function.
(typical-point coordinate-system)
Given an ICoordinateSystem
, returns a unique, symbolically-represented
point on the manifold associated with coordinate-system
.
See typical-coords
for a coordinate-based version of this function.
Given an [[ICoordinateSystem]], returns a unique, symbolically-represented point on the manifold associated with `coordinate-system`. See [[typical-coords]] for a coordinate-based version of this function.
(with-coordinate-prototype coordsys prototype)
Returns an identical coordsys
with the new coordinate-prototype
installed.
Returns an identical `coordsys` with the new `coordinate-prototype` installed.
(zero-manifold-function point)
Manifold function that maps every input manifold point
to the scalar value 0.
Manifold function that maps every input manifold `point` to the scalar value 0.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close