Skip to content

khumnath/panchanga-calculator

Repository files navigation

Panchanga Calculator

A TypeScript/React application that calculates Hindu astrological elements (Panchanga) for any given date based on Kathmandu, Nepal's coordinates.

Features

  • Calculates daily Panchanga elements:
    • Tithi (Lunar Day)
    • Nakshatra (Lunar Mansion)
    • Yoga (Sun-Moon Angular Relationship)
    • Karana (Half Lunar Day)
    • Rashi (Moon Sign)
  • Provides Solar calendar information:
    • Solar Month (based on sidereal sun position)
    • Solar Day (progress in current solar month)
    • Days in Month (variable 29-32 days)
  • Shows timings for:
    • Sunrise and Sunset
    • Tithi Start and End times
  • Includes detailed debug information for astronomical calculations
  • Responsive design with Tailwind CSS
  • Built with TypeScript for type safety

Prerequisites

  • Node.js (v16 or higher)
  • npm (v7 or higher) or yarn (v1.22 or higher)
  • Git (for cloning the repository)

Installation

  1. Clone the repository:
git clone https://github.com/khumnath/panchanga-calculator.git
cd panchanga-calculator
  1. Install dependencies:
npm install
# or
yarn install
  1. Start the development server:
npm run dev
# or
yarn dev
  1. Open your browser and navigate to http://localhost:5173

Build

To create a production build:

npm run build
# or
yarn build

The build output will be in the docs directory.

Technical Details

  • Frontend: React 18 with TypeScript
  • Styling: Tailwind CSS for modern, utility-first styling
  • Build Tool: Vite for fast development and optimized builds
  • Location: Fixed to Kathmandu, Nepal (27.7172°N, 85.324°E)
  • Time Zone: Nepal Time (UTC+5:45)
  • Package Manager: npm or yarn

Astronomical Calculations

The calculator implements several astronomical algorithms:

  • Lahiri Ayanamsa for sidereal calculations
  • Solar and Lunar position calculations
  • Sunrise/Sunset computations for given latitude/longitude
  • Tithi (lunar phase) boundary detection with iterative refinement
  • Solar month boundaries based on sidereal solar longitudes

Limitations

  • Calculations are optimized for Kathmandu, Nepal
  • Results may vary from traditional almanacs due to:
    • Simplified astronomical formulae
    • Different ayanamsa (precession) models
    • Rounding of times and angles
  • Date range: 1900-2100 CE for best accuracy
  • Solar day calculations may occasionally differ from traditional calendars
  • Tithi boundary times are approximate within ±2 minutes
  • All calculations are geometric (no atmospheric refraction)

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Please ensure your code follows the existing code style and appropriate comments.

License

This project is licensed under the GNU General Public License v3.0 or later - see the LICENSE file for details.

Copyright (C) 2025 Khumnath Cg nath.khum@gmail.com

Acknowledgments

  • Based on traditional Hindu astronomical calculations
  • Modern astronomical algorithms adapted for web usage
  • Inspired by traditional Panchanga almanacs
  • UI design inspired by modern web applications

Releases

No releases published

Packages

 
 
 

Contributors