Class Reg_Cl_Plane_Curve
is defined in curves.web.
It is derived from Path
using public
derivation.
Reg_Cl_Plane_Curve
is not called
“Regular_Closed_Plane_Curve
” because the longer name
causes too many “Overfull boxes”1
in the CWEAVE output of the program code.
See CWEB Documentation.
Reg_Cl_Plane_Curve
is meant to be used as a base class; no
objects should be declared of type Reg_Cl_Plane_Curve
.
Currently, class Ellipses
is derived from
Reg_Cl_Plane_Curve
and class Circle
is derived from
Ellipse
.
At present, I have no fixed definition of what constitutes
“regularity” as far as Reg_Cl_Plane_Curves
are concerned.
Ellipses and circles are “regular” in the sense that they have axes of
symmetry. There must be an equation for a Reg_Cl_Plane_Curve
,
such as
x^2 + y^2 = r^2
for a circle.
A derived class should have a solve()
function that uses this
equation. Reg_Cl_Plane_Curve::intersection_points()
in turn uses
solve()
to find the intersection points of a line with the
Reg_Cl_Plane_Curve
. This way, the derived classes don't need
their own functions for finding their intersections with a line.
However, such functions can be added, if desired.
It is assumed that classes derived from Reg_Cl_Plane_Curve
are
fillable, which implies that they must be closed Paths
.
Reg_Cl_Plane_Curves
inherit their drawing and filling functions
from Path
.
The constructors and setting functions of classes derived from
Reg_Cl_Plane_Curve
must ensure that the resulting geometric
figures are planar, convex, and that the number of Points
they contain is
a multiple of 4. The latter assumption is of importance in
intersection_points()
, segment()
, half()
, and
quarter()
.
See Regular Closed Plane Curve Reference; Intersections, and
Regular Closed Plane Curve Reference; Segments.
[1] If you don't know what “overfull boxes” are, don't worry about it. It has to do with TeX's line and page breaking algorithms. If you want to know more, see Knuth, Donald E., The TeXbook.