(coordinate-functions coordinate-system)
Returns a structure similar to the [[manifold/coordinate-prototype]] of
coordinate-system
, where every entry is a function from manifold point =>
the associated component of the point in the coordinate representation
described by coordinate-system
.
Returns a structure similar to the [[manifold/coordinate-prototype]] of `coordinate-system`, where every entry is a function from manifold point => the associated component of the point in the coordinate representation described by `coordinate-system`.
(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 sicmutils.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 [[sicmutils.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.
(let-coordinates bindings & body)
similar to a let
binding that holds pairs of
<coordinate-structure-prototype>, <coordinate-system>
And internally binds, for each pair: (take [x y]
and m/R2-rect
as
examples):
The coordinate system symbol R2-rect
to a new version of the coordinate
system with its coordinate-prototype
replaced by the one you supplied.
That's (up x y)
in this example.
the entries x
and y
to coordinate functions, ie, functions from manifold
point to this particular coordinate
d:dx
and d:dy
vector field procedures (I'm fuzzy here!)
dx
and dy
1-forms for each coordinate (fuzzy here too!)
Example:
(let-coordinates [[x y] R2-rect
[r theta] R2-polar]
;; bindings:
;; R2-rect, x, y, d:dx, d:dy, dx, dy
;; R2-polar, r, theta, d:dr, d:dtheta, dr, dtheta
body...)
similar to a `let` binding that holds pairs of <coordinate-structure-prototype>, <coordinate-system> And internally binds, for each pair: (take `[x y]` and `m/R2-rect` as examples): - The coordinate system symbol `R2-rect` to a new version of the coordinate system with its `coordinate-prototype` replaced by the one you supplied. That's `(up x y)` in this example. - the entries `x` and `y` to coordinate functions, ie, functions from manifold point to this particular coordinate - `d:dx` and `d:dy` vector field procedures (I'm fuzzy here!) - `dx` and `dy` 1-forms for each coordinate (fuzzy here too!) Example: ```clojure (let-coordinates [[x y] R2-rect [r theta] R2-polar] ;; bindings: ;; R2-rect, x, y, d:dx, d:dy, dx, dy ;; R2-polar, r, theta, d:dr, d:dtheta, dr, dtheta body...) ```
(quotify-coordinate-prototype xf p)
Scmutils wants to allow forms like this:
(using-coordinates (up x y) R2-rect ...)
Note that x
, y
are unquoted. This function converts such an unquoted form
into a quoted one that could be evaluated to return an up-tuple of the
symbols:
(up 'x 'y)
Such an object is useful for [[structure/mapr]]. The function xf
is applied
before quoting.
Scmutils wants to allow forms like this: ```clojure (using-coordinates (up x y) R2-rect ...) ``` Note that `x`, `y` are unquoted. This function converts such an unquoted form into a quoted one that could be evaluated to return an up-tuple of the symbols: ```clojure (up 'x 'y) ``` Such an object is useful for [[structure/mapr]]. The function `xf` is applied before quoting.
(using-coordinates coordinate-prototype coordinate-system & body)
using-coordinates
wraps let-coordinates
and allows you to supply a
single coordinate prototype and a single coordinate system.
See let-coordinates
for details about what symbols are bound inside the
body.
NOTE: Prefer let-coordinates
when possible.
Example:
(using-coordinates (up x y) R2-rect
body...)
[[using-coordinates]] wraps [[let-coordinates]] and allows you to supply a single coordinate prototype and a single coordinate system. See [[let-coordinates]] for details about what symbols are bound inside the body. NOTE: Prefer [[let-coordinates]] when possible. Example: ```clojure (using-coordinates (up x y) R2-rect body...) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close