A Rust implementation for calculating the five main elements (Pancha-anga) of the Hindu Astrological Calendar. This tool provides accurate calculations for traditional Hindu astrological elements based on astronomical algorithms and planetary positions.
Calculates the following elements of Panchanga:
- Tithi (तिथि): Lunar Day
- Nakshatra (नक्षत्र): Lunar Mansion
- Yoga (योग): Luni-Solar Day
- Karana (करण): Half Lunar Day
- Rashi (राशि): Zodiac Sign
- Rust programming language (latest stable version)
- Cargo package manager
- Clone the repository:
git clone https://github.com/chinmayvivek/panchang-rs.git
cd panchang-rs- Build the project:
cargo build --releaseThe compiled binary will be available in target/release/panchang-rs
The Panchanga Calculator can be used via the REST API.
The Panchanga Calculator also provides a REST API endpoint that accepts HTTP POST requests.
POST http://localhost:8080/panchang
Request Body (JSON):
{
"date": "15/08/2023",
"time": "12:30",
"zone": "+05:30"
}Using curl:
curl -X POST "http://localhost:8080/panchang" \
-H "Content-Type: application/json" \
-d '{"date":"15/08/2023","time":"12:30","zone":"+05:30"}'Using httpie:
http POST "http://localhost:8080/panchang" \
date="15/08/2023" time="12:30" zone="+05:30"Response (JSON):
{
"tithi": "Prathame, Shukla Paksha",
"nakshatra": "Pushya",
"yoga": "Vishkambha",
"karana": "Bava",
"rashi": "Simha"
}- Uses Lahiri's method for Ayanamsa calculations
- Implements simplified VSOP87 algorithm for solar position
- Implements simplified ELP2000 algorithm for lunar position
- Accounts for various periodic perturbations in planetary orbits
- All calculations are based on J2000.0 epoch
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Based on traditional Hindu astrological principles
- Uses modern astronomical algorithms for accurate calculations
- Inspired by various open-source Panchanga calculators