• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++cocoaobjective-cc#誰得gamephpbathyscaphelinuxrubyqtcomegat翻訳pythontwitterwindowsbtronvb.nettestframeworkgui計画中(planning stage)directxpreviewerpukiwikidommruby

Functions for working with the idealized calendar of Planet Xhilr


Commit MetaInfo

Revision1613405c2405a2b1661e878a2c18fbc3d59a7121 (tree)
Time2017-06-13 18:18:37
AuthorJoel Matthew Rees <joel.rees@gmai...>
CommiterJoel Matthew Rees

Log Message

Now it runs more or less correctly.

Change Summary

Incremental Difference

--- a/econmonths.fs
+++ b/econmonths.fs
@@ -801,14 +801,15 @@ RD2LCYCLE 16 * CONSTANT NUCYCLE ( numerator: 7760 )
801801 ( s = 601018 / 1223988 )
802802 : SMTARGET
803803 [ 2. SMPERIOD10976 UMD* 2DROP 3 DECYCLE UM* D-
804- SMPERIOD10976 UMD* ( Scale it py period and keep high double word. )
804+ SMPERIOD10976 UMD* ( Scale it by period and keep high double word. )
805805 4. SMPERIOD10976 DECYCLE 0 D- UMD* 2DROP
806806 SLOW-UMD/MOD 2SWAP 2DROP SWAP
807807 ] LITERAL LITERAL ;
808-( Used SMTARGET like this with SMOFFFRAC10976 set to 0.: )
809-( 34 3 STYCYCLES 5 DMADJUST SMSTATEFRAC10976 D@ SMTARGET D- D. 76151 )
808+( Used SMTARGET like this, with SMOFFFRAC10976 set to 0.: )
809+( 34 3 STYCYCLES 5 DMADJUST SMSTATEFRAC10976 D@ SMTARGET 2SWAP D- )
810+( SMPERIOD10976 D+ D. <enter> 311395 OK )
810811 0 CONSTANT SMOFFINT ( Slow moon offset at year 0 day 0, integer part. )
811-: SMOFFFRAC10976 ( Fractional part. ) [ 76151. SWAP ] LITERAL LITERAL ;
812+: SMOFFFRAC10976 [ 311395. SWAP ] LITERAL LITERAL ; ( Fractional part. )
812813
813814 ( Below was guessing wrong: )
814815 ( [ SM32NDPERIOD10976 28 UDS* DROP )
@@ -833,8 +834,23 @@ RD2LCYCLE 16 * CONSTANT NUCYCLE ( numerator: 7760 )
833834 : FMPERIOD10976 [ FMPERIODINT DECYCLE UM* FMPERIODFRAC10976 0 D+ SWAP ] LITERAL LITERAL ;
834835 ( 7 1364 / 10976 == 78196 / 10976 )
835836
837+( start + mt = 1/2, start + gt = 3/4 => t * { g - m } = 1/4 => t = 1 / 4 * { g - m } )
838+( g = 1 rot/day, m = -10976 / 78196 rev/day => t = 1 / { 4 * [ 78196 + 10976 ] / 78196 } )
839+( s + gt = 3/4 => s = 3/4 - t; s = 3/4 - 1 / { 4 * [ 78196 + 10976 ] / 78196 } )
840+( s + mt = 1/2 => s = 1/2 - mt; s = 1/2 + 10976 / [ 4 * { 78196 + 10976 } ] )
841+( s = [ 2 * 78196 + 3 * 10976 ] / [ 4 * { 78196 + 10976 } ] )
842+( s = 189318 / 356684 )
843+: FMTARGET
844+ [ 2. FMPERIOD10976 UMD* 2DROP 3 DECYCLE UM* D+
845+ FMPERIOD10976 UMD* ( Scale it by period and keep high double word. )
846+ 4. FMPERIOD10976 DECYCLE 0 D+ UMD* 2DROP
847+ SLOW-UMD/MOD 2SWAP 2DROP SWAP
848+ ] LITERAL LITERAL ;
849+( Used FMTARGET like this, with FMOFFFRAC10976 set to 0.: )
850+( 34 3 STYCYCLES 5 DMADJUST FMSTATEFRAC10976 D@ FMTARGET 2SWAP D- )
851+( D. <enter> 4287 OK )
836852 0 CONSTANT FMOFFINT ( Fast moon offset at year 0 day 0, integer part. )
837-0 CONSTANT FMOFFFRAC10976 ( Fractional part. )
853+: FMOFFFRAC10976 [ 4287. SWAP ] LITERAL LITERAL ; ( Fractional part. )
838854
839855 ( Modern Forths will leave the initialization 0 behind. )
840856 0 VARIABLE FMSTATEINT ( Fast moon state integer part. )
@@ -850,8 +866,9 @@ RD2LCYCLE 16 * CONSTANT NUCYCLE ( numerator: 7760 )
850866 ( can be a little slow. )
851867 : FMSHOWPHASE ( --- ) ( Show the Fastmoon phase with no spacing. )
852868 FMSTATEFRAC10976 D@ FM32NDPERIOD10976 D+ 0. FM16THPERIOD10976 SLOW-UMD/MOD
853- 2SWAP 2DROP DROP DUP 16 < 0= IF 16 - THEN
854- JIRPERDAY 1 - SWAP - ( Retrograde. )
869+ 2SWAP 2DROP DROP
870+ JIRPERDAY SWAP - ( Retrograde. )
871+ DUP 16 < 0= IF 16 - THEN
855872 ." F:" HEX 0 .R DECIMAL
856873 ;
857874
@@ -958,7 +975,7 @@ RD2LCYCLE 16 * CONSTANT NUCYCLE ( numerator: 7760 )
958975 ( Intended to be called from STYCYCLES. Other use will leave things out of sync. )
959976 : FASMSTCYCLES ( ddays --- )
960977 DECYCLE S>D UMD* FMPERIOD10976 SLOW-UMD/MOD
961- 2SWAP FMOFFFRAC10976 S>D D+
978+ 2SWAP FMOFFFRAC10976 D+
962979 2DUP FMPERIOD10976 D< 0= IF
963980 FMPERIOD10976 D- 2SWAP 1. D+ 2SWAP
964981 THEN