Avatar for Andreas_Rozek

Andreas_Rozek

Member since Dec 2019 • Last active Jan 2022
  • 69 conversations
  • 350 comments

Physicist, Senior Developer and IT Consultant, University Lecturer, Freelancer and Startup Founder

Most recent activity

  • in Bangle.js
    Avatar for Andreas_Rozek

    Thank you very much for your enormous effort!

  • in Bangle.js
    Avatar for Andreas_Rozek

    I would definitely welcome such a change!

  • in Bangle.js
    Avatar for Andreas_Rozek

    Well, since our formulae seem to be comparable, you may just copy all the code from my moon phase complication and adapt it for your radius and color settings - that's it. Everything else would require more work.

  • in Bangle.js
    Avatar for Andreas_Rozek

    Good morning!

    I just compared the moon phase calculation of the moon phase widget with that of my moon phase complication for analog clocks using the following code:

      function compareMoonphasesAt (today) {
      /**** Code from Moonphase Widget ****/
      
        const MC = 29.5305882, NM = 694039.09;
        var r = 11, mx = this.x + 12; my = this.y + 12;
      
        function moonPhase(d) {
          var tmp, month = d.getMonth(), year = d.getFullYear(), day = d.getDate();
          if (month < 3) {year--; month += 12;}
          tmp = ((365.25 * year + 30.6 * ++month + day - NM) / MC);
          return Math.round(((tmp - (tmp | 0)) * 7)+1);
        }
      
      /**** Code from Moonphase Complication ****/
      
        const MillisPerDay   = 86400000;
        const synodicalMonth = 29.530588;
      
        let Phase = (
          (today/MillisPerDay - new Date(2009,11,31, 20,12,36)/MillisPerDay) % synodicalMonth
        ) / synodicalMonth;
      
        if (Phase < 0) { Phase += 1; } // just in case that date is completely wrong
      
      /**** make the latter comparable to the former ****/
      
        Phase -= 0.5; if (Phase < 0) { Phase += 1; }
        Phase = Math.round(Phase * 7)+1;
      
      /**** print comparison ****/
      
        let day = today.getDate();
        print(
          '2022-01-' + (day < 10 ? '0' : '') + day + ': ' + 
          moonPhase(today) + ' vs. ' + Phase
        );
      }
    
      for (let Day = 17-14; Day < 17+14; Day++) {
        compareMoonphasesAt(new Date(2022,0,Day));
      }
    

    The output of that little script is:

    2022-01-03: 8 vs. 8
    2022-01-04: 1 vs. 1
    2022-01-05: 1 vs. 1
    2022-01-06: 2 vs. 2
    2022-01-07: 2 vs. 2
    2022-01-08: 2 vs. 2
    2022-01-09: 2 vs. 2
    2022-01-10: 3 vs. 3
    2022-01-11: 3 vs. 3
    2022-01-12: 3 vs. 3
    2022-01-13: 3 vs. 3
    2022-01-14: 4 vs. 4
    2022-01-15: 4 vs. 4
    2022-01-16: 4 vs. 4
    2022-01-17: 4 vs. 4
    2022-01-18: 5 vs. 5
    2022-01-19: 5 vs. 5
    2022-01-20: 5 vs. 5
    2022-01-21: 5 vs. 5
    2022-01-22: 5 vs. 5
    2022-01-23: 6 vs. 6
    2022-01-24: 6 vs. 6
    2022-01-25: 6 vs. 6
    2022-01-26: 6 vs. 6
    2022-01-27: 7 vs. 7
    2022-01-28: 7 vs. 7
    2022-01-29: 7 vs. 7
    2022-01-30: 7 vs. 7
    

    This looks as if the calculation itself is correct.

    What might lead to less optimal graphics is the low number of different indices - compared to user requirements (e.g., according to the numbers, "full moon" is shown from Jan 14 to Jan 17 incl. - this collides with "it's ever so slightly slightly waning")

    Thus, what may (might?) finish this discussion could be a more detailed drawing of the current moon phase in the widget?

  • in Bangle.js
    Avatar for Andreas_Rozek

    "Pastel" seems to contain some obvious bugs: partSunIcon <> sunPartIcon, stormIcon is missing...

  • in Bangle.js
    Avatar for Andreas_Rozek

    I'll try and look into it tomorrow morning - my problem is that other unfinished work is piling up...

  • in Bangle.js
    Avatar for Andreas_Rozek

    Well, I don't know if @Gordon likes my code style (I'm not using any IDE but my own aspect-oriented code generation system (for multiple programming languages) backed by a database - completely different from what other people normally use). But the result is MIT-licensed anyway, thus, if he finds it useful, he may integrate it in whatever way he likes (including docs)

    Please note: the ACCK is not an app! AC-AC however is - but that's already part of the Bangle apps.

    I would feel honoured if I could bring Bangle.js development forward a little bit!

  • in Bangle.js
    Avatar for Andreas_Rozek

    I just renamed the "four-fold" and "twelve-fold" clock faces to "four-numbered" and "twelve-numbered" and created new GitHub repositories for them. The new names seem to be more accurate than the old ones.

    The old repositories will remain for a while before they eventually will be deleted. All docs and examples have been adapted to the new names and repos. New users should not experience any difficulties, legacy users should change to the new faces/repos within the next few weeks.

Actions