draw_tangle#

Functions

add_corners_and_smoothen(zz)

add corners to the zig-zag line, so it starts and ends in a rectangle (the bounding box)

angle_between_points(z1, z2, z3)

return angle between three complex points, 0 if parallel

are_continuation(a, b, radius)

connect(z, w, pos)

Make a connection line with vertical, horizontal or diagonal lines between points z (left) and w (right) pos can be "N" or "S"

crossings(expr)

return the number of crossings

draw(expr[, translate])

Convert the tangle expr, convert it to a zig-zag line and plot it.

draw_smooth(expr)

integral(n)

Integral tangle, return a sum of 1's or -1's

to_zigzag(expr)

Convert a algebraic tangle into a geometric zig-zag line

Classes

TangleExpr(term1, term2)

General expression for a tangle, either Sum or Product of tangles stored in an array

TangleProduct(term1, term2)

Formal product of tangles

TangleSum(term1, term2)

Formal sum of tangles

ZigZag()

Class to draw a zig-zag line.