$center_pos_x = -$cw_sign_glyph / 2; $center_pos_y = $ch_sign_glyph / 2; $offset_pos_x = $center_pos_x * cos($angle_to_use); $offset_pos_y = $center_pos_y * sin($angle_to_use); $x1 = $center_pos_x + $offset_pos_x + (-$radius + $gap_sign_glyph) * cos($angle_to_use); $y1 = $center_pos_y + $offset_pos_y + ($radius - $gap_sign_glyph) * sin($angle_to_use); if ($i == 1 or $i == 5 or $i == 9) { $clr_to_use = $red; } elseif ($i == 2 or $i == 6 or $i == 10) { $clr_to_use = $green; } elseif ($i == 3 or $i == 7 or $i == 11) { $clr_to_use = $orange; } elseif ($i == 4 or $i == 8 or $i == 12) { $clr_to_use = $blue; } drawboldtext($im, 16, 0, $x1 + $center_pt, $y1 + $center_pt, $clr_to_use, HAMBURG_TTF, chr($sign_glyph[$i]), 1); } // ------------------------------------------ // put planets in chartwheel - person 1 - add planet glyphs around circle // sort longitudes in descending order from 360 down to 0 Sort_planets_by_descending_longitude($num_planets, $longitude1, $sort1, $sort_pos1); $flag = False; for ($i = $num_planets - 1; $i >= 0; $i--) { // $sort1() holds longitudes in descending order from 360 down to 0 // $sort_pos1() holds the planet number corresponding to that longitude $angle_to_use = deg2rad($sort1[$i] - $Ascendant1); // needed for placing info on chartwheel if ($flag == False) { display_planet_glyph1($angle_to_use, $radius - $dist_from_diameter1, $xy); } else { display_planet_glyph1($angle_to_use, $radius - $dist_from_diameter1b, $xy);
// is there an aspect within orb? if ($da <= $orb) { $q = 1; } elseif ($da <= 60 + $orb and $da >= 60 - $orb) { $q = 6; } elseif ($da <= 90 + $orb and $da >= 90 - $orb) { $q = 4; } elseif ($da <= 120 + $orb and $da >= 120 - $orb) { $q = 3; } elseif ($da <= 150 + $orb and $da >= 150 - $orb) { $q = 5; } elseif ($da >= 180 - $orb) { $q = 2; } if ($q > 0 and $j != $last_planet_num - 2) { drawboldtext($im, 14, 0, $margins + $cell_width * ($i + 0.15), $cell_height + $cell_height * ($j + 1 - 0.2), $asp_color[$q], HAMBURG_TTF, chr($asp_glyph[$q]), 0); } } } // draw the image in png format - using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); exit; function safeEscapeString($string) { // replace HTML tags '<>' with '[]' $temp1 = str_replace("<", "[", $string); $temp2 = str_replace(">", "]", $temp1); // but keep <br> or <br /> // turn <br> into <br /> so later it will be turned into "" // using just <br> will add extra blank lines