PHPackages                             leonboot/ra-dec-to-alt-az - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. leonboot/ra-dec-to-alt-az

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

leonboot/ra-dec-to-alt-az
=========================

A PHP Right Ascension and Declination to Altitude and Azimuth for the users current Earth Position and time

v0.1.1(9y ago)16751PHP

Since Jul 25Pushed 9y ago2 watchersCompare

[ Source](https://github.com/leonboot/ra-dec-to-alt-az)[ Packagist](https://packagist.org/packages/leonboot/ra-dec-to-alt-az)[ RSS](/packages/leonboot-ra-dec-to-alt-az/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

RA/Dec to Alt/Az PHP Class
==========================

[](#radec-to-altaz-php-class)

> This repository is a fork of [Tom Gillespy's RA/Dec to Alt/Az repository](https://github.com/tomgillespy), with the sole purpose of making the class `composer` installable. Some code refactoring was done, most importantly the class has been put into its own namespace.

This class converts celestial coordinates, along with the time, latitude and longditude to a altitude and azimuth for a telescope mount or camera.

\##Installation

```
composer install leonboot/ra-dec-to-alt-az
```

\##Usage

```
require 'vendor/autoload.php';

use Radec\Calculator as radec;

$radec = new radec(radec::decimaldegrees(latitude), radec::decimaldegrees(longditude));

$radec->setradec(radec::decimaldegrees(right_ascention), radec::decimaldegrees(declination));

$time = strtotime('now');

$azimuth = $radec->getAZ($time);
$altitude = $radec->getALT($time);
```

\##Other Functions

\####Radec\\Calculator::daysbeforeJ2000($timestamp)

This gives the number of days between $timestamp and the J2000 epoch. [Wikipedia Article](http://en.wikipedia.org/wiki/Epoch_(astronomy)#Julian_years_and_J2000)

\####Radec\\Calculator::getdecimalUT($timestamp)

This gives the universitl time in decimal form. All calculations in this are performed using decimals from degrees, minutes and seconds and the time equivalent (hours, minuites and seconds).

\####Radec\\Calculator::fractionalday($timestamp)

This just divides the UT by 24 to get the fraction of a day.

\####Radec\\Calculator::getLST($timestamp)

This calculated Local Sidereal time for the latitude and longditude set in the constructor. The approximation is within 0.3 seconds of time for dates within 100 years of J2000.

\####Radec\\Calculator::getHA($timestamp)

Gets the current hour angle - the current angle of the observers location relative to the celestial sphere.

\####Radec\\Calculator::getALT($timestamp)

Returns the altitude of the specificed target at this time at a location.

\####Radec\\Calculator::getAZ($timestamp)

Returns the azimuth of the specified target at this time at a location.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

2

Last Release

3619d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1777675?v=4)[Leon Boot](/maintainers/leonboot)[@leonboot](https://github.com/leonboot)

---

Top Contributors

[![leonboot](https://avatars.githubusercontent.com/u/1777675?v=4)](https://github.com/leonboot "leonboot (12 commits)")[![tomgillespy](https://avatars.githubusercontent.com/u/3787440?v=4)](https://github.com/tomgillespy "tomgillespy (4 commits)")

### Embed Badge

![Health badge](/badges/leonboot-ra-dec-to-alt-az/health.svg)

```
[![Health](https://phpackages.com/badges/leonboot-ra-dec-to-alt-az/health.svg)](https://phpackages.com/packages/leonboot-ra-dec-to-alt-az)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
