More documentation improvements.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 17 Oct 2006 17:47:37 +0000 (17:47 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 17 Oct 2006 17:47:37 +0000 (17:47 +0000)
doc/HACKING
src/sst.py

index ef0ddb90e678a3deabd6156e9aa89ceeaf3759ad..1cef4b4edc3d1f38338f57f01dc0ad5338caae9e 100644 (file)
@@ -245,3 +245,25 @@ FORTRAN all the vector representation was done with parallel arrays;
 in C, I introduced a struct; in Python, the class has a complete
 repertoire of vector-algebra operations.
 
 in C, I introduced a struct; in Python, the class has a complete
 repertoire of vector-algebra operations.
 
+There's one weird archeological detail about the nav code that
+deserves a remark.  This program originally required input in terms of
+a (clock) direction and distance -- essentially, directions were real
+numbers modulo 12 with zero being north.  Somewhere in history, it was
+changed to Cartesian coordinates.  But the bearing method still computes
+polar coordinates in clockface units -- that's the reason for the
+wacky constant 1.90985, inherited straight from the ancestral FORTRAN.
+Elsewhere, there were a bunch of computations, now centralized in the
+course object, that looked like (15.0 - bearing)*0.5235988; this is a 
+conversion from clockface units to radians with zero on the X axis.
+
+As a previous maintainer, probably Tom Almy, observed: Probably
+"manual" input should still be done this way -- it's a real pain if
+the computer isn't working! Manual mode is still confusing because it
+involves giving x and y motions, yet the coordinates are always
+displayed y - x, where +y is downward!
+
+Because I think he's arguably right, I haven't ripped out all the
+clockface-to-radian conversions.  For this reason, and others, the 
+trig code is still a bit wacky and obscure.  Modify with caution
+and test thoroughly.
+
index 637a65db0033cbc66e1be7d5caee8881cd37ee4f..59c5ffcce607eb77c7aadee123253ce86a3cc1d1 100644 (file)
@@ -3530,14 +3530,6 @@ def dock(verbose):
        prout(_("Lt. Uhura- \"Captain, an important message from the starbase:\""))
        attackreport(False)
        game.iseenit = True
        prout(_("Lt. Uhura- \"Captain, an important message from the starbase:\""))
        attackreport(False)
        game.iseenit = True
-# This program originally required input in terms of a (clock)
-# direction and distance. Somewhere in history, it was changed to
-# cartesian coordinates. So we need to convert.  Probably
-# "manual" input should still be done this way -- it's a real
-# pain if the computer isn't working! Manual mode is still confusing
-# because it involves giving x and y motions, yet the coordinates
-# are always displayed y - x, where +y is downward!
 
 def cartesian(loc1=None, loc2=None):
     if loc1 is None:
 
 def cartesian(loc1=None, loc2=None):
     if loc1 is None: