from cxregions import *Detected IPython. Loading juliacall extension. See https://juliapy.github.io/PythonCall.jl/stable/compat/#IPython
A curve is a smooth, non-self-intersecting curve in the extended complex plane. The curve parameter is a real number in the range \([0,1]\) that is used to traverse the curve.
Every Curve subtype is expected to implement the following methods. (Here C represents a value of type Curve and z is a number.)
| Method | Description |
|---|---|
C.point(t), or C(t) |
Complex point on C at parameter value t in [0,1]. |
C.tangent(t) |
Complex tangent to C at t. |
C.unittangent(t) |
Normalized tangent to C at t. |
C.normal(t) |
Unit (leftward) normal to C at t. |
C.arclength() |
Arc length of C. |
C.reverse() |
Reverse the direction of traversal. |
C.isfinite() |
True if the curve does not pass through infinity. |
C.conj() |
Complex conjugate of the curve. |
C + z, z + C |
Translation of the curve by z. |
C - z |
Translation of the curve by z. |
-C |
Negate the curve. |
C * z |
Multiply the curve C by complex number z; i.e., scale and rotate it about the origin. |
inv(C) |
Invert the curve pointwise through the origin. |
A Curve object represents an implementation given by a manually specified parameterization of the curve and its tangent. Given the (bounded) complex-valued functions \(f\) and \(df\) defined on \([0,1]\), then Curve(f, df) represents the curve \(z=f(t)\). If \(f\) is defined on \([a, b]\) instead, then Curve(f, df, a, b) is appropriate, but all future work with the curve object uses the standard interval \([0,1]\) for the parameter. All Curve values are expected to be finite; i.e., C.isfinite() will always be true.
The ClosedCurve subtype is used to signify that the starting and ending points of the curve are (approximately) identical. In addition to the methods of Curve, it provides the following:
| Method | Description |
|---|---|
C.winding(z) |
Winding number of C about z. |
C.hasinside(z::Number, C) |
Detect whether z lies inside the curve. |
In addition to the minimal methods for all Curve objects, each of the subtypes below provides the following methods. (C is a value of one of these types, and z is a number.)
| Method | Description |
|---|---|
C.arg(z) |
Curve parameter value of a given point on the curve. |
C1.isapprox(C2) |
Determine whether two values represent the same curve. |
C.isleft(z), C.isright(z) |
Determine whether a point lies “to the left” or “to the right” of a line, ray, or segment in its given orientation. |
C.dist(z) |
Distance from a point to the curve. |
C.closest(z) |
Point on the curve nearest to a given number. |
Like other curves, a line is parameterized over \([0,1]\), with L(0) and L(1) both being infinity.
Line(a, b) creates the line through the values \(a\) and \(b\).Line(p, direction=s) creates a line through the point p in the direction of the complex number s.Line(p, angle=theta) creates a line through the point p at the angle theta.Use L.reflect(z) to find the reflection of a point z across line L.
Ray(z, theta) constructs a ray starting at z and extending to infinity at the angle theta.Ray(z, theta, true) constructs a ray starting at infinity and extending to z at the angle theta.Segment(a, b) constructs the line segment from a to b.Circle(z, r) constructs a circle centered at z with radius r, oriented counterclockwise.Circle(z, r, false) constructs the circle with clockwise orientation.Circle(a, b, c) constructs the circle through the points a, b, and c. The ordering of the points determines the orientation of the circle. If the points are collinear, a Line is returned instead.Use C.reflect(z) to reflect a point z through the circle C.
Arc(a, b, c) constructs the circular arc through the given three points. If the points are collinear, a Segment is returned.Arc(C, start, delta) constructs an arc from a Circle C, starting at the given start value and extending an amount delta. The values are expressed as fractions of a full rotation starting from the real axis.Detected IPython. Loading juliacall extension. See https://juliapy.github.io/PythonCall.jl/stable/compat/#IPython
Line through (0.5+0j) at angle 0.5 * pi
winding of c about z = 1.5: -1
winding of c about z = -1: 0
tangent of c at 0.75: (6.283185307179586+0j)
reflection of -1 across c: (0.5-2.0816681711721685e-17j)
2*c - 2: Circle centered at -5.551115123125783e-17j with radius 2.0