Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 58 additions & 34 deletions src/astrologer/aspects.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,92 @@ const { normalizeDegrees } = require('./utils')
const ASPECTS = {
0: 'conjunction',
30: 'semisextile',
45: 'octile',
60: 'sextile',
72: 'quintile',
90: 'quadrature',
120: 'trigone',
135: 'trioctile',
144: 'biquintile',
150: 'quincunx',
180: 'opposition'
}

// HUBER ORBS... but mars and jupiter modified...
// Orbs values used by Liz Greene
const DEFAULT_ORBS = {
luminary: {
0: 10,
30: 3,
60: 5,
90: 6,
120: 8,
150: 5,
45: 3,
60: 6,
72: 2,
90: 10,
120: 10,
135: 3,
144: 2,
150: 3,
180: 10
},
personal: {
0: 7,
30: 2,
60: 4,
90: 5,
120: 6,
150: 2,
180: 7
0: 10,
30: 3,
45: 3,
60: 6,
72: 2,
90: 10,
120: 10,
135: 3,
144: 2,
150: 3,
180: 10
},
social: {
0: 6,
30: 1.5,
60: 3,
90: 4,
120: 5,
0: 10,
30: 3,
45: 3,
60: 6,
72: 2,
90: 10,
120: 10,
135: 3,
144: 2,
150: 3,
180: 6
180: 10
},
transpersonal: {
0: 5,
30: 1,
60: 2,
90: 3,
120: 4,
150: 2,
180: 5
0: 10,
30: 3,
45: 3,
60: 6,
72: 2,
90: 10,
120: 10,
135: 3,
144: 2,
150: 3,
180: 10
},
other: {
0: 5,
30: 1,
60: 2,
90: 3,
120: 4,
150: 2,
180: 5
0: 0,
30: 0,
45: 0,
60: 0,
72: 0,
90: 0,
120: 0,
135: 0,
144: 0,
150: 0,
180: 0
}
}

const calculateAspect = (first, second, orbs) => {
return Object.keys({ ...ASPECTS }).filter(
(a) => {
const totalOrbsForAspect = orbs[a]
const from = parseFloat(a) - (totalOrbsForAspect / 2)
const to = parseFloat(a) + (totalOrbsForAspect / 2)
const from = parseFloat(a) - totalOrbsForAspect
const to = parseFloat(a) + totalOrbsForAspect

const firstLongitude = normalizeDegrees(first.position.longitude)
const secondLongitude = normalizeDegrees(second.position.longitude)
Expand Down