Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This loop loops trough each planet then looks if there is aspect with any other planet that is further away
- // In natal horocopes the sun can make aspects with all planet. But planets that are further away, can't make a
- // aspect with the sun. So the sun can make a aspect with pluto, but pluto can't make a aspect with the sun. This
- // this loops does this in the right order
- for ($i = 0; $i <= 9; $i++)
- {
- for ($j = $i + 1; $j <= 10; $j++)
- {
- $planet_positions = swe_calc_ut($jd, $plnr, 0, $planet_positions, $serr);
- // To find a aspects, we need to know the distance between two planets. Substracting the two different planet
- // positions will give you the remaining distance. Using ABS the value will always be positive.
- // For example lets say the sun is at 91.986084 decimal degrees and Mercury is at 92.223671 this would result
- // in a positive value as −0.237587, which is less then aspect + or - orb. So its a aspect.
- $da = Abs($planet_positions[$i] - $planet_positions[$j]);
- // We use radian degrees to find aspect, distance will not be more then 180 degrees
- if ($da > 180)
- {
- $da = 360 - $da;
- }
- define The orb of a aspect.
- $orb = 5;
- // Q = 1 by default, which means no aspect has been found yet.
- $q = 1;
- // if da is less not bigger then orb, set q=2 mean conjunction
- if ($da <= $orb)
- {
- $q = 2;
- }
- // if da is 60 degrees , set q=3 means sextile aspect
- elseif (($da <= 60 + $orb) And ($da >= 60 - $orb))
- {
- $q = 3;
- }
- // if da is 90 degrees, set q=4 means square aspect
- elseif (($da <= 90 + $orb) And ($da >= 90 - $orb))
- {
- $q = 4;
- }
- // if da is 120 degrees, set q=5 means trine aspect
- elseif (($da <= 120 + $orb) And ($da >= 120 - $orb))
- {
- $q = 5;
- }
- // if da is 180 degrees, set q=6 means opposite aspect
- elseif ($da >= 180 - $orb)
- {
- $q = 6;
- }
- // if $q is more then one, a aspect has been found
- if ($q > 1)
- {
- // What aspect?
- if ($q == 2)
- {
- $aspect = "Conjunction";
- }
- elseif ($q == 3)
- {
- $aspect = "Sextile";
- }
- elseif ($q == 4)
- {
- $aspect = "Square";
- }
- elseif ($q == 5) {
- $aspect = "trine";
- }
- elseif ($q == 6) {
- $aspect = "opposite"
- }
- // Print line of aspect for example sun square moon....
- $aspects[] = $planet_name[$i] . $aspect . $planet_name[$j] // string with aspect
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement