['latitude' => 27.7172, 'longitude' => 85.3240],
'Pokhara' => ['latitude' => 28.2096, 'longitude' => 83.9856],
'Lalitpur' => ['latitude' => 27.6644, 'longitude' => 85.3188],
'Bhaktapur' => ['latitude' => 27.6710, 'longitude' => 85.4298],
'Biratnagar' => ['latitude' => 26.4525, 'longitude' => 87.2718],
'Chitwan' => ['latitude' => 27.5291, 'longitude' => 84.3542],
'Butwal' => ['latitude' => 27.7000, 'longitude' => 83.4480]
];
$latitude = '';
$longitude = '';
$localDateTime = '';
$utcDateTime = '';
$unixTimestamp = '';
$julianDay = '';
$decimalHour = '';
$apiError = '';
$samplePlanets = [];
$planetsByHierarchy = [];
$positionsInOrder = [];
$ascendantLongitude = null;
$ascendantData = null;
if (!empty($location) && isset($locationMap[$location])) {
$latitude = $locationMap[$location]['latitude'];
$longitude = $locationMap[$location]['longitude'];
}
function getJulianDayFromDateTime($date, $time, $timezone = 'Asia/Kathmandu')
{
$dt = new DateTime("$date $time", new DateTimeZone($timezone));
$dtUtc = clone $dt;
$dtUtc->setTimezone(new DateTimeZone('UTC'));
$year = (int)$dtUtc->format('Y');
$month = (int)$dtUtc->format('m');
$day = (int)$dtUtc->format('d');
$hour = (int)$dtUtc->format('H');
$minute = (int)$dtUtc->format('i');
$second = (int)$dtUtc->format('s');
$decimalHour = $hour + ($minute / 60) + ($second / 3600);
if ($month <= 2) {
$year -= 1;
$month += 12;
}
$A = floor($year / 100);
$B = 2 - $A + floor($A / 4);
$jd = floor(365.25 * ($year + 4716))
+ floor(30.6001 * ($month + 1))
+ $day + $B - 1524.5
+ ($decimalHour / 24);
return [
'local_datetime' => $dt->format('Y-m-d H:i:s'),
'utc_datetime' => $dtUtc->format('Y-m-d H:i:s'),
'unix_timestamp' => $dt->getTimestamp(),
'julian_day' => round($jd, 6),
'decimal_hour' => round($decimalHour, 6)
];
}
if (!empty($date) && !empty($time) && !empty($location) && isset($locationMap[$location])) {
$calcData = getJulianDayFromDateTime($date, $time);
$localDateTime = $calcData['local_datetime'];
$utcDateTime = $calcData['utc_datetime'];
$unixTimestamp = $calcData['unix_timestamp'];
$julianDay = $calcData['julian_day'];
$decimalHour = $calcData['decimal_hour'];
$realPlanetData = getRealPlanetaryData($date, $time, (float)$latitude, (float)$longitude);
$realPlanetLongitudes = $realPlanetData['planets'];
$ascendantLongitude = $realPlanetData['ascendant'];
$apiError = $realPlanetData['error'];
if (!empty($realPlanetLongitudes)) {
foreach ($realPlanetLongitudes as $planet) {
$samplePlanets[] = buildPlanetDataFromLongitude(
$planet['key'],
$planet['longitude'],
$nameMode
);
}
} elseif (empty($apiError)) {
$apiError = 'Could not fetch planetary data from remote API.';
}
if ($ascendantLongitude !== null) {
$ascendantData = buildPlanetDataFromLongitude('sun', $ascendantLongitude, $nameMode);
}
}
$planetsByHierarchy = $samplePlanets;
$positionsInOrder = sortPlanetsByLongitude($samplePlanets);
?>
Prajwal's Astro Analysis
Prajwal's Astro Analysis
Analyze planetary positioning, nakshatra, and horoscope from selected date, time, and location.
Geocentric Positioning of Planets
Date: = htmlspecialchars($date ?: '-') ?>
Time: = htmlspecialchars($time ?: '-') ?>
Location: = htmlspecialchars($location ?: '-') ?>
Latitude: = $latitude !== '' ? htmlspecialchars((string)$latitude) : '-' ?>
Longitude: = $longitude !== '' ? htmlspecialchars((string)$longitude) : '-' ?>
Local DateTime: = $localDateTime ?: '-' ?>
UTC DateTime: = $utcDateTime ?: '-' ?>
Unix Timestamp: = $unixTimestamp !== '' ? $unixTimestamp : '-' ?>
Decimal Hour (UTC): = $decimalHour !== '' ? $decimalHour : '-' ?>
Julian Day: = $julianDay !== '' ? $julianDay : '-' ?>
Ascendant Longitude: = htmlspecialchars((string)round($ascendantLongitude, 6)) ?>
Ascendant Sign: = htmlspecialchars($ascendantData['sign']) ?>
Ascendant Degree: = htmlspecialchars($ascendantData['degree']) ?>
Ascendant Nakshatra: = htmlspecialchars($ascendantData['nakshatra']) ?>
= htmlspecialchars($apiError) ?>
Please select date, time, and location, then click Analyze.
Table 1: Positions by Planets
| Planet |
Segment |
Sign |
Degree |
Nakshatra |
| = htmlspecialchars($planet['name']) ?> |
= htmlspecialchars($planet['house']) ?> |
= htmlspecialchars($planet['sign']) ?> |
= htmlspecialchars($planet['degree']) ?> |
= htmlspecialchars($planet['nakshatra']) ?> |
| No planetary data available. |
Table 2: Positions in Order
| Segment |
Planet |
Sign |
Degree |
Nakshatra |
| = htmlspecialchars($planet['house']) ?> |
= htmlspecialchars($planet['name']) ?> |
= htmlspecialchars($planet['sign']) ?> |
= htmlspecialchars($planet['degree']) ?> |
= htmlspecialchars($planet['nakshatra']) ?> |
| No ordered planetary data available. |