Description Usage Arguments Details Value Note Author(s) Examples
Various functionality to impose different types of symmetry on knots
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | force_nodes_mirror_images_LR(x,symobj)
force_nodes_mirror_images_UD(x,symobj)
force_nodes_exactly_horizontal(x,symobj)
force_nodes_exactly_vertical(x,symobj)
force_nodes_on_V_axis(x,xver)
force_nodes_on_H_axis(x,xhor)
force_nodes_rotational(x,symobj)
symmetrize(x,symobj)
tag_notneeded(x, Mver, xver, Mhor, xhor, Mrot,exact_h,exact_v)
make_minsymvec_from_minobj(x,symobj)
minsymvec(vec)
make_minobj_from_minsymvec(minsymvec,symobj)
symmetry_object(x, Mver=NULL, xver=NULL, Mhor=NULL, xhor=NULL,
Mrot=NULL, exact_h=NULL, exact_v=NULL,
mcdonalds=FALSE, celtic=FALSE, reefknot=FALSE,center_crossing=FALSE)
knot(x, overunderobj, symobj, Mver=NULL, xver=NULL, Mhor=NULL,
xhor=NULL, Mrot=NULL, mcdonalds=FALSE, celtic=FALSE,
reefknot=FALSE,center_crossing=FALSE)
|
x |
Object coerced to class |
Mver,Mhor |
Matrices specifying vertical (horizontal) symmetry, with two columns. The rows specify pairs of symmetric nodes about a vertical (horizontal) axis. Nodes specified by the first column should be on the left (upper) side |
Mrot |
A matrix specifying rotational symmetry. Each row corresponds to a set of nodes in a rotational relationship. The number of columns specifies the order of the rotational symmetry |
xver,xhor |
Vector specifying nodes to be on the vertical (horizontal) axis of symmetry. The nodes are assumed to flow from left to right |
exact_h,exact_v |
Vector specifying nodes to be exactly horizontal or exactly vertical. A node is exactly horizontal (vertical) if the y(x) coordinate of the node is the same as the y(x) coordinate of the handle. Note that the position of an exactly horizontal node is not restricted, and may be anywhere |
symobj |
An object representing the symmetry of the knot, usually
created by function |
mcdonalds |
For vertical symmetry, argument |
celtic |
Like |
reefknot |
Like |
center_crossing |
Implements a peculiar type of rotational
symmetry in which the strands pass through the geometrical center of
the knot projection. The only common knot needing this is
|
minsymvec |
A “minimal symmetric vector”. This is a
numeric vector containing just the independent degrees of freedom of
a knot, after symmetry constraints have been imposed. The idea is
that one may optimize a |
vec |
A vector, given to function |
overunderobj |
A matrix specifying the overs and the unders; a two-column matrix with rows corresponding to pairs of strands intersecting. The first element of a row identifies the overstrand and the second element specifies the understrand |
Function symmetry_object()
creates a symmetry object
from Mver
et seq, but if given a knot
object, returns
the embedded symmetry object.
Functions force_nodes_mirror_images_LR()
and
force_nodes_mirror_images_UD()
symmetrize a knot about a vertical
(horizontal) axis by taking ordered pairs of nodes, specified by
matrix Mver
(Mhor
) and forcing the second node to be
symmetrically placed with respect to the first
Functions force_nodes_exactly_horizontal()
and
force_nodes_exactly_vertical()
force nodes to be exactly
horizontal or exactly vertical respectively. Nodes so forced do not
need to be on an axis of symmetry; they can be anywhere
Function symmetrize_ROT()
symmetrizes a knot around a
point of symmetry, producing a rotationally symmetric knot
These functions return a symmetric knot in minobj
form.
You can achieve up-down symmetry (that is, a horizontal line of symmetry) by making a left-right symmetric knot and rotating by 90 degrees. D'oh.
Robin K.S. Hankin
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # each row of M = a pair of symmetrical nodes; each element of v is a
# node on the vertical axis
M <- matrix(c(6,4,13,11,7,3,2,8,9,1,14,10),byrow=TRUE,ncol=2)
v <- c(5,12) # on vertical axis
sym_7_3 <- symmetry_object(k7_3, M, v)
k <- symmetrize(as.minobj(k7_3), sym_7_3)
knotplot2(k) #nice and symmetric!
## OK now convert to and from a mimimal vector for a symmetrical knot:
mii <- make_minsymvec_from_minobj(k, sym_7_3)
pii <- make_minobj_from_minsymvec(mii,sym_7_3)
knotplot2(pii)
## So 'mii' is a minimal vector for a symmetrical knot, and 'pii' is
## the corresponding minobj object. Note that you can mess about with
## mii, but whatever you do the resulting knot is still symmetric:
mii[2] <- 1000
knotplot2(make_minobj_from_minsymvec(mii,sym_7_3)) # still symmetric.
## and, in particular, you can optimize the badness, using nlm():
## Not run:
fun <- function(m){badness(make_minobj_from_minsymvec(m,sym_7_3))}
o <- nlm(fun,mii,iterlim=4,print.level=2)
knotplot2(make_minobj_from_minsymvec(o$estimate,sym_7_3))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.