Skip to content

Instantly share code, notes, and snippets.

@jscuba
Created May 30, 2022 22:58
Show Gist options
  • Save jscuba/a3c24f0ba49937f9885249a1aa931d16 to your computer and use it in GitHub Desktop.
Save jscuba/a3c24f0ba49937f9885249a1aa931d16 to your computer and use it in GitHub Desktop.
vedic astrology combustion calculation
const sunDegree = vargaData.graha.Sy.rashi * 30.0 + vargaData.graha.Sy.degree
...
let dist = Math.abs(sunDegree - (data.rashi * 30.0 + data.degree))
dist = Math.min(dist, 360 - dist)
switch (data.graha) {
case 'Sy':
break
case 'Ch':
if (dist < 12) {
data.combust = true
}
break
case 'Ma':
if (dist < 17) {
data.combust = true
}
break
case 'Bu':
if (data.speed >= 0) {
if (dist < 14) {
data.combust = true
}
} else if (dist < 12) {
data.combust = true
}
break
case 'Gu':
if (dist < 11) {
data.combust = true
}
break
case 'Sk':
if (data.speed >= 0) {
if (dist < 10) {
data.combust = true
}
} else if (dist < 8) {
data.combust = true
}
break
case 'Sa':
if (dist < 15) {
data.combust = true
}
break
case 'Ra':
break
case 'Ke':
break
default:
break
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment