I've used Swiss Ephemeris to calculate planetary positions, using PHP and tested today's date 12-12- 2015, time 18:00 and location Delhi ( 29 N, 77 E)
Here are the results
Sun - 235 vs 236 on other sites (astrosage.com) Moon - 251 vs 249 Ascendant 160 vs 65
I've tried 3 different methods to calculate the longitude of the ascendant, but I've got it wrong all the time. Also the longitudes of the Sun and Moon vary in degrees.
<?php
$year= 2015;
$month=12;
$date=12;
$time=18;
$geo_lat_delhi= 29;
$geo_long_delhi= 77;
$jul_day_UT = swe_julday($year,$month,$date,$time,SE_GREG_CAL);
$swe_day_ut = swe_sidtime($jul_day_UT);
echo "=======Sun sign===========";
$p = 0;
$ret_flag_sun = swe_calc_ut($jul_day_UT,$p,SEFLG_SIDEREAL);
echo '<pre>';
print_r($ret_flag_sun);
echo "=======Moon sign===========";
$p = 1;
$ret_flag_moon = swe_calc_ut($jul_day_UT,$p,SEFLG_SIDEREAL);
echo '<pre>';
print_r($ret_flag_moon);
echo "===Method1 Ascendant =Cusp [1]====";
$asc1 = swe_houses($jul_day_UT,$geo_lat_delhi,$geo_long_delhi,'A');
echo '<pre>';
print_r($asc1);
echo "===Method2 Ascendant =Cusp [1]====";
swe_set_sid_mode(SE_SIDM_LAHIRI,0,0);
$asc2 = swe_houses_ex($jul_day_UT,SEFLG_SIDEREAL,$geo_lat_delhi,$geo_long_delhi,'A');
echo '<pre>';
print_r($asc2);
echo "===Method3 Ascendant =Cusp [1]====";
$asc3 = swe_houses_ex($swe_day_ut,SEFLG_SIDEREAL,$geo_lat_delhi,$geo_long_delhi,'A');
echo '<pre>';
print_r($asc3);
exit;
?>
You can view the results here - farfaraway.co/swisscode.php
Do you any idea where am I going wrong, any help will be much appreciated.
Cheers!