X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=doc%2FHACKING;fp=doc%2FHACKING;h=1cef4b4edc3d1f38338f57f01dc0ad5338caae9e;hp=ef0ddb90e678a3deabd6156e9aa89ceeaf3759ad;hb=6f4f98ea41c6c792d99bceb2618c659ead349c08;hpb=10dd0ac8c8c0985fb0fa2087b33ea435cd21f9de diff --git a/doc/HACKING b/doc/HACKING index ef0ddb9..1cef4b4 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -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. +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. +