Sunday, September 23, 2018

TECH | Planetary Hour Calculator/Calendar App

I wrote an Objective-C class that calculates the planetary hours for the current day and night based on the location of iPhone, iPad or Apple Watch, and adds those as events to the Calendar app on any MacOS or iOS device, as well as an app that displays the current planetary hour via a complication on the face of Apple Watch:

The graphic circular and graphic corner complications, displaying the previous, current and upcoming planetary hours on the Apple Watch Series 4
Although the specific intent of the code is to supply a means for developers to add this data to their own apps, I've provided a few sample implementations showing the code at work:
My Planetary Hour app for Apple Watch Series 4, as it appears in the Watch app for iOS
Here's one for WatchOS:

My Planetary Hour app, running in the WatchOS simulator
The video below shows an example implementation of calendar events being added for each planetary hour in the Calendar app on iPhone using the class-supplied data:



Here's another iOS app that shows the coordinate of each planetary on a map in real-time:


Here's a similar app showcasing the ability to determine the coordinate of each planetary hour at a specific time of day (not just the current time), which was used to create a "fast-forward" of the progress of each planetary hour as they transit the globe over the course of a day:


These are a couple of basic examples of ways planetary hour data can represented in apps. My original intention was to display the data on an Apple Watch Series 4 via a complication using ClockKit; I think a time graph that encircles the clock face and counts down each hour would be nice.
Now that I have a working planetary-hour data provider, it should just be a matter of supplying ClockKit with the data for the various complication templates it provides [see Developing Complications for Apple Watch Series 4].


Update on January 11th, 2019
I finally managed to get the complication on the face of the actual watch:
Of all the things that I thought would be difficult, this wasn't one of them; but, four months later, this is the best I've done so far:



When the strength of demons' weaponry was observed to be stronger during some planetary hours while weaker in others, I made a wildly incorrect and very ignorant human assumption that it was a demon horde somehow associated with a particular planetary body could only provide power to deployed weapons because of the actual physical position of a given planet [see reading past posts on the relationship between planetary hours and astrology and demonic activity]. As it turns out, planetary hours do not correspond to a planet locations; they correspond to demons' locations.

These locations are called "houses," in which demons divide themselves into "bands" by cloaking to exhibit identical characteristics that keep them together. If that doesn't make sense, search for cloak on The Life of a Demoniac | Quora and read each post.
NOTE | Think Bacchus, who travels with the springtide as it progresses around the globe.
A house is one of 24 (almost) equally was divided longitudinal sections of the globe; they are bordered by sunrise and sunset, and divided into two: day and night. The length (or size) of a day hour is the duration of time between sunrise to sunset for a given day divided by 12; same for night, but from sunset to sunrise of the next day. Demons of the same house all dwell within the geographic border of a planetary hour, and move with that house (or hour) as time progresses. In their cloaked state, they can actually be moved by the sun's "current," which varies in "strength" depending on how close or far a demon is from solar noon. All demons in the same house modify the strength of their cloak in the same way, so that they all are propelled or pushed at the tail of their house by the head of the house behind as it sweeps across the globe (or something like that).

The reason why the strength, then, of weapons varies from planetary hour to planetary hour is because not all bands get along. If they did, bands wouldn't be akin to different countries; rather, they'd be more like states all belonging to the same country.
NOTE | That's only one of a dozen reasons for a lack of participation; but, because opposition increased in strength every time demons decreased, I'm concluding that there is (or maybe was, but definitely can be) animosity between adjacent houses.
The following Xcode Console output generated by NSLog shows the planetary-hour dictionary keys and real-world values for each, which were derived from the actual sunrise and sunset times acquired by api.sunrise-sunset.org):

2018-10-13 09:11:06.652273-0400 PlanetaryHoursFramework[14349:720599] Planetary hours dictionary desc: {
    0 =     {
        Saturn = "planet_name";
        "2018-10-14 01:33:21 +0000" = "start_date";
        "\U2644" = "planet_symbol";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
        "2018-10-14 03:28:38 +0000" = "end_date";
    };
    1 =     {
        "2018-10-14 05:23:55 +0000" = "end_date";
        "\U2609" = "planet_symbol";
        Sun = "planet_name";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
        "2018-10-14 03:28:38 +0000" = "start_date";
    };
    10 =     {
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
        "\U2642\Ufe0e" = "planet_symbol";
        Mars = "planet_name";
        "2018-10-14 20:46:14 +0000" = "start_date";
        "2018-10-14 22:41:31 +0000" = "end_date";
    };
    11 =     {
        "2018-10-15 00:36:49 +0000" = "end_date";
        Mercury = "planet_name";
        "\U263f" = "planet_symbol";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
        "2018-10-14 22:41:31 +0000" = "start_date";
    };
    2 =     {
        "2018-10-14 05:23:55 +0000" = "start_date";
        "2018-10-14 07:19:13 +0000" = "end_date";
        "\U263d" = "planet_symbol";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
        Moon = "planet_name";
    };
    3 =     {
        "2018-10-14 09:14:30 +0000" = "end_date";
        "2018-10-14 07:19:13 +0000" = "start_date";
        "\U2642\Ufe0e" = "planet_symbol";
        Mars = "planet_name";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
    };
    4 =     {
        "2018-10-14 09:14:30 +0000" = "start_date";
        "2018-10-14 11:09:47 +0000" = "end_date";
        "\U263f" = "planet_symbol";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
        Mercury = "planet_name";
    };
    5 =     {
        "2018-10-14 11:09:47 +0000" = "start_date";
        "\U2643" = "planet_symbol";
        Jupiter = "planet_name";
        "2018-10-14 13:05:05 +0000" = "end_date";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
    };
    6 =     {
        "\U2640\Ufe0e" = "planet_symbol";
        Venus = "planet_name";
        "2018-10-14 15:00:22 +0000" = "end_date";
        "2018-10-14 13:05:05 +0000" = "start_date";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
    };
    7 =     {
        Saturn = "planet_name";
        "2018-10-14 16:55:39 +0000" = "end_date";
        "2018-10-14 15:00:22 +0000" = "start_date";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
        "\U2644" = "planet_symbol";
    };
    8 =     {
        "\U2609" = "planet_symbol";
        "2018-10-14 16:55:39 +0000" = "start_date";
        Sun = "planet_name";
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
        "2018-10-14 18:50:57 +0000" = "end_date";
    };
    9 =     {
        location = "<+37.33233141,-122.03121860> +/- 5.00m (speed 0.00 mps / course -1.00) @ 10/13/18, 9:11:05 AM Eastern Daylight Time";
        Moon = "planet_name";
        "\U263d" = "planet_symbol";
        "2018-10-14 20:46:14 +0000" = "end_date";
        "2018-10-14 18:50:57 +0000" = "start_date";
    };
}

The source code for JBPlanetaryHourCalculator is available on GitHub.