[Wcurve-devel] Code update!

kirkjam@iit.edu kirkjam@iit.edu
Tue, 1 Apr 2003 19:36:00 -0600


So, here's what I did:

My initial task was to implement a "line-wrapping" feature in Wcurve. As
easy 
as this sounds, it posed a few rather interesting problems. First off, ho=
w
can 
we easily know the maxima and minima for a curve, so we can display them
compactly stacked on top of each other? The range has to exist as a diame=
ter,
not just the span of the curve on the x- or y-axis. This is for rotation
purposes (so when
the curve's linewrapped, it can be rotated). Now, if we need a radius, wh=
ere's
the center? We can't use (0,0) since curves can be entirely above or belo=
w
the
x=3D0 or y=3D0 planes. The center has to be defined by the curve. This pr=
oblem,
as
I've found in my computational geometry book, is known as the "smallest
enclosing circle" problem, and it's a bear to implement.

So, rather than re-inventing the wheel, i discovered a library called CGA=
L
which
has the algorithms I needed. Still, to run this on a sequence of billions=

would
bog the program down quite nicely. So, instead of running the min_circle
algorithm on all the points, I decided to throw the points into a 2D-arra=
y
of
boolean "buckets" that indicate whether a point exists within a certain
range
(from gamma to negative gamma in both x and y). This seems to work nicely=
.

Another feature which was implemented in this update is the inclusion of
an
"auto-rotation" feature. This animates every curve displayed, making it
rotate
around it's arbitrary center. Nothing too crazy here.

Yet another modification was how the Wcurve Plot windows open - instead
of being
fullscreen, I decided to make them open as strips 1/5 the height of the
workspace and the entire length of the workspace. The curve stretches fro=
m
the
top to the bottom of this window. When this window is resized, the curve
is
automatically resized, too, to fit the new height. One thing I wish to do=

later,
which might prove to be tricky, is to add a horizontal scrollbar in the
Plotview
window.

That pretty much describes what's been done. If I've horribly munged the
code,
please inform me. Thanks.

-James Kirk