[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Angles and elaps and emacs, oh my!



On 13 Sep 2002, Jay Belanger wrote:

>
> It seems that the epix commands take angle measurements in
> either radians, degrees, or revolutions, depending on the
> particular command.  The inconsistency strikes me as unfortunate, is
> there a reason for it?
>
Expediency and my inexperience (a.k.a. "bad design"), and writing in C (no
overloading). The idea was to minimize the amount of typing (especially to
minimize occurrances of M_PI in source files), but to use radians as much
as possible. Eventually the inconsistency reached the current ugly state,
but I never had the impetus to change things. In practice, revolutions
could be eliminated with no trouble (they're only used in specifying
angular intervals in polar plots). Would degrees or radians be easier to
use as a general angle unit? I suspect degrees are simpler in practice,
though I greatly prefer radians for mathematical reasons. Of course, not
all epix users are mathematicians...

Here's a C++-ish idea: Define two new data types in epix, degree and
radian, and write all functions that accept angle parameters in "degree"
and "radian" forms. This would also encourage the use of symbolic angle
parameters, as in

  theta1 = degree(60);
  theta2 = radian(M_PI_2);

The current functions that accept angle parameters could be retained for
arguments of type "double". Does this seem like a good (i.e., usable, more
consistent) scheme? (I bought Stroustrup's book on C++, and can already
feel his influence. :)

> Also, epix and elaps are somewhat inconsistent; epix can take command
> line arguments of the form -I..., etc., while elaps cannot, and epix
> can handle files which end in either c or cc, while elaps chokes on
> cc.
>
I'll fix this immediately, I hope today.

> Finally, I wrote an emacs mode for epix; essentially, it is c++ mode
> with additional commands for running epix, elaps, going to errors, and
> viewing the eps output of elaps.  It's somewhat crude, but works for
> me.
>
Cool! At the very least, please send a URL.

--Andy

Andrew D. Hwang			ahwang at mathcs dot holycross dot edu
Department of Math and CS	http://mathcs.holycross.edu/~ahwang
College of the Holy Cross	(508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395	(508) 793-3530 (fax)