['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 = '';
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'];
}
/*
SAMPLE PLANET DATA
house = wheel segment number
*/
$samplePlanets = [
buildPlanetDataFromLongitude('sun', 5.20, 1, $nameMode),
buildPlanetDataFromLongitude('moon', 72.13, 3, $nameMode),
buildPlanetDataFromLongitude('mars', 78.35, 3, $nameMode),
buildPlanetDataFromLongitude('mercury', 32.08, 2, $nameMode),
buildPlanetDataFromLongitude('venus', 41.30, 2, $nameMode),
buildPlanetDataFromLongitude('jupiter', 129.18, 5, $nameMode),
buildPlanetDataFromLongitude('saturn', 22.43, 1, $nameMode),
buildPlanetDataFromLongitude('rahu', 304.23, 11, $nameMode),
buildPlanetDataFromLongitude('ketu', 124.23, 7, $nameMode)
];
$planetsByHierarchy = $samplePlanets;
$positionsInOrder = sortPlanetsByLongitude($samplePlanets);
usort($positionsInOrder, function ($a, $b) {
return $a['house'] <=> $b['house'];
});
?>
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 : '-' ?>
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']) ?> |
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']) ?> |