API Reference

Exported types

ComplexRegions.AnnulusType
Annulus(radouter,radinner)
Annulus(radouter,radinner,center)

Construct a concentric annulus of outer radius radouter and inner radius radinner centered at center. If the center is not given, the origin is used.

source
ComplexRegions.ArcType
(type) Arc{T<:AnyComplex} in the complex plane

Each Arc type is parameterized according to the common type of its complex input arguments.

source
ComplexRegions.ArcMethod
Arc(C,start,delta)

Consruct an arc that is the part of the Circle C starting at parameter value start and ending at start+delta. The values are expressed in terms of fractions of a complete circle. The start value should be in [0,1), and delta should be in [-1,1].

Arc(a,b,c)

Construct the arc starting at point a, passing through b, and ending at c. If the three points are collinear, a Segment is returned instead.

source
ComplexRegions.CircleType
Circle(zc,r,ccw=true)

Construct the circle with given center zc, radius r, and orientation (defaults to counterclockwise).

Circle(a,b,c)

Construct the circle passing through the given three numbers. Orientation is determined so that the values are visited in the given order. If the three points are collinear (including when one of the given values is infinite), a Line is returned instead.

source
ComplexRegions.CircleType
(type) Circle{T<:AnyComplex} in the complex plane

Each Circle type is parameterized according to the common type of its complex input arguments.

source
ComplexRegions.CircularPolygonMethod
CircularPolygon(p::AbstractPath; tol=<default>)
CircularPolygon(p::AbstractVector; tol=<default>)

Construct a circular polygon from a (possibly closed) path, or from a vector of curves. The tol parameter is a tolerance used when checking continuity and closedness of the path.

source
ComplexRegions.ClosedCurveType
ClosedCurve(f; tol=<default>)
ClosedCurve(f,a,b; tol=<default)

Construct a ClosedCurve object from the complex-valued function point accepting an argument in the interval [0,1]. The constructor checks whether f(0)≈f(1) to tolerance tol. If a and b are given, they are the limits of the parameter in the call to the supplied f. However, the resulting object will be defined on [0,1], which is internally scaled to [a,b].

ClosedCurve(f,df[,a,b]; tol=<default>)

Construct a closed curve with point location and tangent given by the complex-valued functions f and df, respectively, optionally with given limits on the parameter.

source
ComplexRegions.ClosedPathMethod
ClosedPath(c::AbstractVector; tol=<default>)
ClosedPath(P::Path; tol=<default>)

Given a vector c of curves, or an existing path, construct a closed path. The path is checked for continuity (to tolerance tol) at all of the vertices.

source
ComplexRegions.ConnectedRegionMethod
ConnectedRegion(outer,inner)

Construct an open connected region by specifying its boundary components. The outer boundary could be nothing or a closed curve or path. The inner boundary should be a vector of one or more nonintersecting closed curves or paths. The defined region is interior to the outer boundary and exterior to all the components of the inner boundary, regardless of the orientations of the given curves.

source
ComplexRegions.CurveMethod
Curve(f)
Curve(f,a,b)

Construct a Curve object from the complex-valued function f accepting an argument in the interval [0,1]. If a and b are given, they are the limits of the parameter in the call to the supplied f. However, the resulting object will be defined on [0,1], which is internally scaled to [a,b].

Curve(f,df[,a,b])

Construct a curve with point location and tangent given by the complex-valued functions f and df, respectively, optionally with given limits on the parameter.

source
ComplexRegions.LineType
(type) Line{T<:AnyComplex} in the complex plane

Each Line type is parameterized according to the common type of its complex input arguments.

source
ComplexRegions.LineMethod
Line(a,b)

Construct the line passing through the two given points.

Line(a,direction=z)

Construct the line through the given point and parallel to the complex sign of the given direction value.

source
ComplexRegions.MöbiusMethod
Möbius(A::AbstractMatrix)

Construct the Möbius map $z ↦ (az+b)/(cz+d)$ by giving a matrix A==[a b;c d].

source
ComplexRegions.MöbiusMethod
Möbius(z::AbstractVector,w::AbstractVector)

Construct the Möbius map that transforms the points z[k] to w[k] for k=1,2,3. Values of Inf are permitted in both vectors.

source
ComplexRegions.MöbiusMethod
f(C::Union{Arc,Segment})

Find the image of the arc or segment C under the Möbius map f. The result is also either an Arc or a Segment.

source
ComplexRegions.MöbiusMethod
Möbius(C1,C2)

Construct a Möbius map that transforms the curve C1 to C2. Both curves must be either a Line or Circle. (These maps are not uniquely determined.)

source
ComplexRegions.MöbiusMethod
f(C::Union{Circle,Line})

Find the image of the circle or line C under the Möbius map f. The result is also either a Circle or a Line.

source
ComplexRegions.MöbiusMethod
f(R::Union{AbstractDisk,AbstractHalfplane})

If R is an AbstractDisk or an AbstractHalfplane, find its image under the Möbius map f. The result is also either an AbstractDisk or an AbstractHalfplane.

Examples

julia> f = Möbius(Line(-1,1),Circle(0,1))
Möbius transformation:

   (1.0 + 0.9999999999999999im) z + (3.666666666666666 - 1.666666666666667im)
   ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
   (1.0 + 0.9999999999999999im) z + (-1.666666666666666 + 3.6666666666666665im)

julia> f(upperhalfplane)
Disk interior to:
   Circle(-5.55112e-17+2.22045e-16im,1.0)

julia> isapprox(ans,unitdisk)
true
source
ComplexRegions.PathMethod
Path(c::AbstractVector; tol=<default>)

Given a vector c of curves, construct a path. The path is checked for continuity (to tolerance tol) at the interior vertices.

source
ComplexRegions.PolygonMethod
Polygon(v::AbstractVector)

Construct a polygon from a vector of its vertices. Each element of v should be either a finite vertex, or a tuple of two angles that indicate the angles of two rays incident to an infinite vertex: one "to" infinity, and a second "from" infinity.

source
ComplexRegions.PolygonMethod
Polygon(p::AbstractPath; tol=<default>)
Polygon(p::AbstractVector{T<:AbstractCurve}; tol=<default>)

Construct a polygon from a (possibly closed) path, or from a vector of curves. The tol parameter is a tolerance used when checking continuity and closedness of the path.

source
ComplexRegions.RayType
Ray(a,θ,reverse=false)

Construct the ray starting at a and extending to infinity at the angle θ. If reverse is true, the ray is considered to extend from infinity to a at angle .

source
ComplexRegions.RayType
(type) Ray{T<:AnyComplex} in the complex plane

Each Ray type is parameterized according to the common type of its complex input arguments.

source
ComplexRegions.SegmentType
(type) Segment{T<:AnyComplex} in the complex plane

Each Segment type is parameterized according to the common type of its complex input arguments.

source

Exported functions

Base.:!Method
!(R::SimplyConnectedRegion)

Compute the region complementary to R. This is not quite set complementation, as neither region includes its boundary. The complement is always simply connected in the extended plane.

source
Base.:∘Method
∘(f::Möbius,g::Möbius)

Compose two Möbius transformations.

source
Base.conjMethod
conj(X)

Construct the complex conjugate of curve, path, or region X. (Reverses the orientation of a curve or path.)

source
Base.inMethod
in(z::Number,R::AbstractRegion;tol=<default>)
z ∈ R   (type "\in" followed by tab)

True if z is in the region R.

source
Base.intersectFunction
intersect(c1::AbstractCurve,c2::AbstractCurve; tol=<default>)

Find the intersection(s) of two curves. The result could be a vector of zero or more values, or a curve.

source
Base.intersectMethod
intersect(R1::AbstractRegion,R2::AbstractRegion)
R1 ∩ R2    (type "\cap" followed by tab key)

Create the region that is the intersection of R1 and R2.

source
Base.invMethod
inv(A)

Invert the arc A through the origin. In general the inverse is an Arc, though the result is a Segment if the arc's circle passes through the origin.

source
Base.invMethod
inv(C)

Invert the circle C through the origin. In general the inverse is a Circle, though the result is a Line if C passes through the origin.

source
Base.invMethod
inv(L)

Invert a line L through the origin. In general the inverse is a Circle through the inverse of any three points on the line.

source
Base.invMethod
inv(f::Möbius)

Find the inverse of a Möbius transformation. This is the functional inverse, not 1/f(z).

source
Base.invMethod
inv(R)

Invert the ray R through the origin. In general the inverse is an Arc.

source
Base.invMethod
inv(S)

Invert the segment S through the origin. In general the inverse is an Arc, though the result is a Segment if S would pass through the origin when extended.

source
Base.invMethod
inv(X)

Invert a curve, path, or region pointwise.

source
Base.isapproxMethod
isapprox(A1::Arc,A2::Arc; tol=<default>)
A1 ≈ A2

Determine if A1 and A2 represent the same arc, irrespective of the type or values of its parameters. Identity is determined by agreement within tol, which is interpreted as the weaker of absolute and relative differences.

source
Base.isapproxMethod
isapprox(C1::Circle,C2::Circle; tol=<default>)
C1 ≈ C2

Determine if C1 and C2 represent the same circle, irrespective of the type or values of its parameters. Identity is determined by agreement within tol, which is interpreted as the weaker of absolute and relative differences.

source
Base.isapproxMethod
isapprox(P1::AbstractPath,R2::AbstractPath; tol=<default>)
P1 ≈ P2       (type "\approx" followed by tab key)

Determine whether P1 and P2 represent the same path, up to tolerance tol, irrespective of the parameterization of its curves.

source
Base.isapproxMethod
isapprox(L1::Line,L2::Line; tol=<default>)
L1 ≈ L2

Determine if L1 and L2 represent the same line, irrespective of the type or values of its parameters. Identity is determined by agreement within tol, which is interpreted as the weaker of absolute and relative differences.

source
Base.isapproxMethod
isapprox(R1::Ray,R2::Ray; tol=<default>)
R1 ≈ R2

Determine if R1 and R2 represent the same segment, irrespective of the type or values of its parameters. Identity is determined by agreement within tol, which is interpreted as the weaker of absolute and relative differences.

source
Base.isapproxMethod
isapprox(S1::Segment,S2::Segment; tol=<default>)
S1 ≈ S2

Determine if S1 and S2 represent the same segment, irrespective of the type or values of its parameters. Identity is determined by agreement within tol, which is interpreted as the weaker of absolute and relative differences.

source
Base.isapproxMethod
isapprox(R1::SimplyConnectedRegion,R2::SimplyConnectedRegion; tol=<default>)

Determine whether R1 and R2 represent the same region, up to tolerance tol. Equivalently, determine whether their boundaries are the same.

source
Base.isfiniteMethod
isfinite(C::AbstractCurve)

Return true if the curve is bounded in the complex plane (i.e., does not pass through infinity).

source
Base.isfiniteMethod
isfinite(P::AbstractPath)

Return true if the path is bounded in the complex plane (i.e., does not pass through infinity).

source
Base.isfiniteMethod
isfinite(R::AbstractRegion)

Return true if the region is bounded in the complex plane.

source
Base.reverseMethod
reverse(X)

Construct a curve or path identical to X except with opposite direction of parameterization.

source
Base.truncateMethod
truncate(P::Union{CircularPolygon,Polygon},C::Circle)

Compute a trucated form of the polygon by replacing each pair of rays incident at infinity with two segments connected by an arc along the given circle. This is not a true clipping of the polygon, as finite sides are not altered. The result is either a CircularPolygon or the original P.

source
Base.truncateMethod
truncate(P::Union{CircularPolygon,Polygon})

Apply truncate to P using a circle that is centered at the centroid of its finite vertices, and a radius twice the maximum from the centroid to the finite vertices.

source
Base.unionMethod
union(R1::AbstractRegion,R2::AbstractRegion)
R1 ∪ R2    (type "\cup" followed by tab key)

Create the region that is the union of R1 and R2.

source
ComplexRegions.anglesMethod
angles(P::AbstractPath)

Return a vecrtor of the interior angles at the vertices of the path P. The length is one greater than the number of curves in P, and the first and last values are NaN.

source
ComplexRegions.anglesMethod
angles(P::AbstractPath)

Return a vecrtor of the interior angles at the vertices of the path P. The length is one greater than the number of curves in P, and the first and last values are NaN.

source
ComplexRegions.anglesMethod
angles(P::Polygon)

Compute a vector of interior angles at the vertices of the polygon P. At a finite vertex these lie in (0,2π]; at an infinite vertex, the angle is in [-2π,0].

source
ComplexRegions.arclengthMethod
arclength(X)

Fetch or compute the arc length of the curve or path X.

Example

julia> ellipse = ClosedCurve( t->cos(t)+2im*sin(t), 0,2π );
julia> arclength(ellipse)  # good to about 10 digits
9.688448219981513
source
ComplexRegions.argMethod
arg(A::Arc,z)

Find the parameter argument t such that A(t)==z is true.

This gives undefined results if z is not actually on the arc.

source
ComplexRegions.argMethod
arg(C::Circle,z)

Find the parameter argument t such that C(t)==z is true.

This gives undefined results if z is not actually on the circle.

source
ComplexRegions.argMethod
arg(L::Line,z)

Find a parameter argument t such that L(t)==z is true. For an infinite z, return zero (but note that L(1) is also infinity).

This gives undefined results if z is not actually on the line.

source
ComplexRegions.argMethod
arg(R::Ray,z)

Find the parameter argument t such that R(t)==z is true.

This gives undefined results if z is not actually on the ray.

source
ComplexRegions.argMethod
arg(S::Segment,z)

Find the parameter argument t such that S(t)==z is true.

This gives undefined results if z is not actually on the segment.

source
ComplexRegions.betweenMethod
between(outer,inner)

Construct the region interior to the closed curve or path outer and interior to inner.

source
ComplexRegions.curveMethod
curve(P::AbstractClosedPath,k::Integer)

Return the kth curve in the path P. The index is applied circularly; e.g, if the closed path has n curves, then ...,1-n,1,1+n,... all refer to the first curve.

source
ComplexRegions.discretizeFunction
discretize(P::SimplyConnectedRegion, n=600)

Create an n×n grid of points on P. Points lying outside of P have a value of NaN.

If P is an exterior region, the points lie in a box a bit larger than the bounding box of P.

If keyword argument limits is specified, it must be a vector or tuple (xmin, xmax, ymin, ymax) specifying the limits of the grid.

source
ComplexRegions.discretizeMethod
discretize(p, n)

Discretize a path or curve at n points, roughly equidistributed by arc length. All vertices are also included.

Returns a tuple of vectors t and z such that z[j] is the point on the curve at parameter value t[j].

source
ComplexRegions.exteriorMethod
exterior(C)

Construct the region exterior to the closed curve or path C. If C is bounded, the bounded enclosure is chosen regardless of the orientation of C; otherwise, the region "to the right" is the exterior.

source
ComplexRegions.interiorMethod
interior(C)

Construct the region interior to the closed curve or path C. If C is bounded, the bounded enclosure is chosen regardless of the orientation of C; otherwise, the region "to the left" is the interior.

source
ComplexRegions.isinsideMethod
isinside(X,z)

Detect whether z lies inside the closed curve or path X. For a bounded path, this always means the bounded region enclosed by the curve, regardless of orientation; for an unbounded path, it means the region "to the left" as one walks along the path.

source
ComplexRegions.isleftMethod
isleft(z,L::Line)

Determine whether the number z lies "to the left" of line L. This means that the angle it makes with tangent(L) is in the interval (0,π).

Note that isleft and isright are not logical opposites; a point on the curve should give false in both cases.

source
ComplexRegions.isleftMethod
isleft(z,R::Ray)

Determine whether the number z lies "to the left" of ray R. This means that the angle it makes with tangent(R) is in the interval (0,π).

Note that isleft and isright are not logical opposites; a point on the (extended) ray should give false in both cases.

source
ComplexRegions.isleftMethod
isleft(z,S::Segment)

Determine whether the number z lies "to the left" of segment S. This means that the angle it makes with tangent(S) is in the interval (0,π).

Note that isleft and isright are not logical opposites; a point on the (extended) segment should give false in both cases.

source
ComplexRegions.isoutsideMethod
isoutside(X,z)

Detect whether z lies outside the closed curve or path X. For a bounded path, this always means the unbounded region complementary to the enclosure of the curve, regardless of orientation; for an unbounded path, it means the region "to the right" as one walks along the path.

source
ComplexRegions.ispositiveMethod
ispositive(p::CircularPolygon)

Determine whether the circular polygon is positively oriented (i.e., circulates counterclockwise around the points it encloses).

source
ComplexRegions.ispositiveMethod
ispositive(p::Polygon)

Determine whether the polygon is positively oriented (i.e., circulates counterclockwise around the points it encloses).

source
ComplexRegions.isrightMethod
isright(z,L::Line)

Determine whether the number z lies "to the right" of line L. This means that the angle it makes with tangent(L) is in the interval (-π,0).

Note that isleft and isright are not logical opposites; a point on the curve should give false in both cases.

source
ComplexRegions.isrightMethod
isright(z,R::Ray)

Determine whether the number z lies "to the right" of ray R. This means that the angle it makes with tangent(R) is in the interval (-π,0).

Note that isleft and isright are not logical opposites; a point on the (extended) ray should give false in both cases.

source
ComplexRegions.isrightMethod
isright(z,S::Segment)

Determine whether the number z lies "to the right" of segment S. This means that the angle it makes with tangent(S) is in the interval (-π,0).

Note that isleft and isright are not logical opposites; a point on the (extended) segment should give false in both cases.

source
ComplexRegions.normalMethod
normal(C::AbstractCurve,t::Real)

Find the unit complex number in the direction of the leftward-pointing normal to curve C at parameter value t in [0,1].

source
ComplexRegions.normalMethod
normal(P::AbstractPath,t::Real)

Compute a complex-valued normal to path P at parameter value t. Values of t in [k,k+1] correspond to values in [0,1] along curve k of the path, for k = 1,2,...,length(P)-1. The result is not well-defined at an integer value of t.

source
ComplexRegions.pointMethod
point(C::AbstractCurve,t::Real)

Find the point on curve C at parameter value t, which should lie in the interval [0,1].

source
ComplexRegions.pointMethod
point(P::AbstractPath,t::Real)
P(t)

Compute the point along path P at parameter value t. Values of t in [k,k+1] correspond to values in [0,1] along curve k of the path, for k = 1,2,...,length(P)-1.

point(P::AbstractPath,t::AbstractVector)

Vectorize the point method for path P.

source
ComplexRegions.rectangleMethod
rectangle(xlim, ylim)

Construct the rectangle defined by xlim[1] < Re(z) < xlim[2], ylim[1] < Im(z) < ylim[2].

source
ComplexRegions.reflectMethod
reflect(z,C::Circle)

Reflect the value z across the circle C. (For reflection of a circle through a point, use translation and negation.)

source
ComplexRegions.reflectMethod
reflect(z,L::Line)

Reflect the value z across the line L. (For reflection of a line through a point, use translation and negation.)

source
ComplexRegions.reflectMethod
reflect(z,S::Segment)

Reflect the value z across the extension of segment S to a line. (For reflection of a segment through a point, use translation and negation.)

source
ComplexRegions.tangentMethod
tangent(C::AbstractCurve,t::Real)

Find the complex number representing the tangent to curve C at parameter value t in [0,1].

source
ComplexRegions.tangentMethod
tangent(P::AbstractPath,t::Real)

Compute the complex-valued tangent along path P at parameter value t. Values of t in [k,k+1] correspond to values in [0,1] along curve k of the path, for k = 1,2,...,length(P)-1. The result is not well-defined at an integer value of t.

source
ComplexRegions.unittangentMethod
unittangent(C::AbstractCurve,t::Real)

Find the complex number representing the unit tangent to curve C at parameter value t in [0,1]. For Lines, Segments, and Rays, the t argument is optional.

source
ComplexRegions.unittangentMethod
unittangent(P::AbstractPath,t::Real)

Compute the complex-valued unit tangent along path P at parameter value t. Values of t in [k,k+1] correspond to values in [0,1] along curve k of the path, for k = 1,2,...,length(P)-1. The result is not well-defined at an integer value of t.

source
ComplexRegions.vertexMethod
vertex(P::AbstractPath,k::Integer)

Return the kth vertex of the path P. The index is applied circularly; e.g, if the closed path has n curves, then ...,1-n,1,1+n,... all refer to the first vertex.

source
ComplexRegions.verticesMethod
vertices(P::AbstractClosedPath)

Return an array of the unique vertices (endpoints of the curves) of the closed path P. The length is equal the number of curves in P, i.e., the first/last vertex is not duplicated.

source
ComplexRegions.verticesMethod
vertices(P::AbstractPath)

Return an array of the vertices (endpoints of the curves) of the path P. The length is one greater than the number of curves in P.

source
ComplexRegions.windingMethod
winding(P,z)

Compute the winding number of a closed curve or path P about the point z. Each counterclockwise rotation about z contributes +1, and each clockwise rotation about it counts -1. The winding number is zero for points not in the region enclosed by P.

The result is unreliable for points lying on P, for which the problem is ill-posed.

source

Other functions

Base.:+Method
X + z
z + X

Translate a curve, path, or region X by a complex number z.

source
Base.:-Method
z - X

Negate a curve, path, or region X (reflect through the origin) and translate by z.

source
Base.:-Method
X - z

Translate a curve, path, or region X by a number -z.

source
Base.:-Method
-X

Negate a curve, path, or region X (reflect through the origin).

source
Base.isrealMethod
isreal(P::AbstractPath)

Return true if the path is entirely on the real axis.

source
ComplexRegions.defaultMethod
ComplexRegions.default()

Return a dictionary of global default settings for the ComplexRegions package.

ComplexRegions.default(key=value)

Change a global default setting in the running instance of the ComplexRegions package.

source