/
docs.jl
102 lines (83 loc) · 3.23 KB
/
docs.jl
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Documentation for methods defined multiple times in parallel ways, to cut down on repetition/duplication when requesting help.
@doc """
Complex(::AbstractCurve)
Interpret a curve as having points of type Complex.
""" Complex(::AbstractCurve)
@doc """
Polar(::AbstractCurve)
Interpret a curve as having points of type Polar.
""" Polar(::AbstractCurve)
@doc """
Spherical(::AbstractCurve)
Interpret a curve as having points of type Spherical.
""" Spherical(::AbstractCurve)
@doc """
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.
""" winding(::Union{AbstractClosedCurve,AbstractClosedPath})
# curve/path/region
AbstractCPR = Union{AbstractCurve,AbstractPath,AbstractRegion}
@doc """
X + z
z + X
Translate a curve, path, or region `X` by a complex number `z`.
""" +(::AbstractCPR)
@doc """
-X
Negate a curve, path, or region `X` (reflect through the origin).
""" -(::AbstractCPR)
@doc """
X - z
Translate a curve, path, or region `X` by a number `-z`.
""" -(::AbstractCPR,::Number)
@doc """
z - X
Negate a curve, path, or region `X` (reflect through the origin) and translate by `z`.
""" -(::Number,::AbstractCPR)
@doc """
z*X
X*z
Multiply the curve, path, or region `X` by complex number `z`; i.e., scale and rotate it about the origin.
""" *(::AbstractCPR)
@doc """
X/z
Multiply the curve, path, or region `X` by the number `1/z`; i.e., scale and rotate it about the origin.
""" /(::AbstractCPR,::Number)
@doc """
z/X
Invert the curve, path, or region `X` pointwise and multiply by the number `z`.
""" /(::Number,::AbstractCPR)
@doc """
inv(X)
Invert a curve, path, or region pointwise.
""" inv(::AbstractCPR)
@doc """
conj(X)
Construct the complex conjugate of curve, path, or region `X`. (Reverses the orientation of a curve or path.)
""" conj(::AbstractCPR)
# curve/path
AbstractCP = Union{AbstractCurve,AbstractPath}
@doc """
reverse(X)
Construct a curve or path identical to `X` except with opposite direction of parameterization.
""" reverse(::AbstractCP)
@doc """
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
```
""" arclength(::AbstractCP)
AbstractCCP = Union{AbstractClosedCurve,AbstractClosedPath}
@doc """
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.
""" isinside(z::Number,C::AbstractCCP)
@doc """
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.
""" isoutside(z::Number,C::AbstractCCP)