2.1.2 • Published 4 years ago

@goldenius/hades-js v2.1.2

Weekly downloads
65
License
MIT
Repository
github
Last release
4 years ago

Hades-js

Don't use this module comercially. It's not stable and I'm still working on the tests and improvements like retrogrades, mid-points, etc.

Features

  • Planetary positions from a geocentric point of view.
  • Placidus and Fixed house systems.
  • ASC, MC, Julian day and sidereal time.

Install

$ npm install @goldenius/hades-js

Usage

At the moment you may only get data for dates between 1900-2050. This is because Hades at the moment does not calculate the points from scratch. It relies on ephemeris (check the resources folder) fed into it.

The easiest way to retrieve planetary positions with aspects and house calculations is to input:

  • date and time (momentjs date object)
  • timezone
  • geodetic location

for example:

const {AstrologyService, AspectService, 
    EphemerisJSONRepository, OrbJSONRepository, 
    TrigonometricUtilities,HouseSystemFactory,
    TimeConversions, WorldTimezoneRepository, 
    ZodiacFactory, GeodeticLocation, HouseSystemType,
    RetrogradesService} = require("@goldenius/hades-js");
const moment = require('moment-timezone');

let timeConversions = new TimeConversions();
let retrogradesService = new RetrogradesService();
let ephemerisJSONRepository = new EphemerisJSONRepository(timeConversions,retrogradesService);
let worldTimezoneRepository = new WorldTimezoneRepository();
let orbRepository = new OrbJSONRepository();
let aspectService = new AspectService(orbRepository);
let trigonometricUtilities = new TrigonometricUtilities();
let zodiacFactory = new ZodiacFactory();
let houseSystemFactory = new HouseSystemFactory(trigonometricUtilities,zodiacFactory);


let astrologyService = new AstrologyService(ephemerisJSONRepository, 
                                        timeConversions, 
                                        worldTimezoneRepository,
                                        aspectService,
                                        houseSystemFactory);

let location = new GeodeticLocation('-58.45','-34.6');
let date = moment('1984-11-18 14:00:00');
let timezone = 'America/Argentina/Buenos_Aires';

let celestialBodiesAndTime = testPlanetCalculation();
let calculatedAspects = testAspects(celestialBodiesAndTime.CelestialBodies);
let calculatedHouses = testHouseCalculation(HouseSystemType.Placidus);

console.log(JSON.stringify(celestialBodiesAndTime));
console.log(JSON.stringify(calculatedAspects));
console.log(JSON.stringify(calculatedHouses));
                                        
function testPlanetCalculation()
{
    return astrologyService.CalculateCelestialBodiesAndTime(date, timezone, location);
}

function testAspects(celestialBodies)
{
    return astrologyService.CalculateAspects(celestialBodies);
}

function testHouseCalculation(houseSystemType)
{
    return astrologyService.CalculateHouseSystem(houseSystemType, date, timezone, location);
}

Regarding House Systems, at this point the only one that is working correctly is Placidus.

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago