{"id":15293627,"url":"https://github.com/djben/spacetime","last_synced_at":"2025-04-13T14:07:40.607Z","repository":{"id":64059982,"uuid":"98088901","full_name":"DJBen/SpaceTime","owner":"DJBen","description":"Astronomical space coordinate and time conversion. Calculate Julian day, local sidereal time and ecliptic obliquity with great precision.","archived":false,"fork":false,"pushed_at":"2018-01-03T09:08:43.000Z","size":1675,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T14:07:33.566Z","etag":null,"topics":["astronomy","carthage","conversion","coordinate","equatorial","julian-date","sidereal","sidereal-time","swift","swift-3"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DJBen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-23T09:56:11.000Z","updated_at":"2023-01-06T00:37:13.000Z","dependencies_parsed_at":"2023-01-14T20:30:38.013Z","dependency_job_id":null,"html_url":"https://github.com/DJBen/SpaceTime","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJBen%2FSpaceTime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJBen%2FSpaceTime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJBen%2FSpaceTime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DJBen%2FSpaceTime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DJBen","download_url":"https://codeload.github.com/DJBen/SpaceTime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724637,"owners_count":21151561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","carthage","conversion","coordinate","equatorial","julian-date","sidereal","sidereal-time","swift","swift-3"],"created_at":"2024-09-30T16:50:14.798Z","updated_at":"2025-04-13T14:07:40.579Z","avatar_url":"https://github.com/DJBen.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Header](https://github.com/DJBen/SpaceTime/raw/master/External%20Assets/T-Blue.png)\n\n# SpaceTime\n\n[![Language](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://swift.org)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Build Status](https://travis-ci.org/DJBen/SpaceTime.svg?branch=master)](https://travis-ci.org/DJBen/SpaceTime)\n\n## Overview\n\n- Conversion among [equatorial coordinate](https://en.wikipedia.org/wiki/Equatorial_coordinate_system) (right ascension and declination), [horizontal coordinate](https://en.wikipedia.org/wiki/Horizontal_coordinate_system) (azimuth and altitude),\n[ecliptic coordinate](https://en.wikipedia.org/wiki/Ecliptic_coordinate_system) (longitude and latitude) and their corresponding Cartesian equivalents.\n- Calculate [Julian Day](https://en.wikipedia.org/wiki/Julian_day) and [Local sidereal time](https://en.wikipedia.org/wiki/Sidereal_time).\n- High precision calculation of the [obliquity of ecliptic](https://en.wikipedia.org/wiki/Ecliptic) good to 0″.04 / 1000 years over 10000 years.\n- Matrix / Quaternion transformation from celestial coordinate system to local tangent plane. Supports [North-East-Down](https://en.wikipedia.org/wiki/North_east_down) coordinate from [earth-centered, earth-fixed](https://en.wikipedia.org/wiki/ECEF) coordinate system for any given longitude, latitude and timestamp.\n\n## Demo\nYou can find a demo project under `SpaceTimeDemo` directory.\nIt showcases several useful scenarios.\n\n![Screenshot](https://github.com/DJBen/SpaceTime/raw/master/External%20Assets/Screenshot.png)\n\n## Installation\n\n### Carthage\n\n    github \"DJBen/SpaceTime\" ~\u003e 0.4.0\n\n## Usage\nEquatorial to horizontal coordinate:\n```swift\n// Supply observer location and timestamp\nlet locTime = ObserverLocationTime(location: location, timestamp: JulianDay.now)\nlet vegaCoord = EquatorialCoordinate(rightAscension: radians(hours: 18, minutes: 36, seconds: 56.33635), declination: radians(degrees: 38, minutes: 47, seconds: 1.2802), distance: 1)\n// Azimuth and altitude of Vega\nlet vegaAziAlt = HorizontalCoordinate.init(equatorialCoordinate: vegaCoord, observerInfo: locTime)\n```\nEcliptic coordinate of Pollux at standard equinox of J2000.0.\n```swift\nlet ra = DegreeAngle(116.328942)\nlet dec = DegreeAngle(28.026183)\nlet eclipticCoord = EclipticCoordinate(longitude: ra, latitude: dec, distance: 1, julianDay: .J2000)\neclipticCoord.longitude.wrappedValue // 113.21563\neclipticCoord.latitude.wrappedValue // 6.68417\n```\nGreenwich Mean Sidereal Time:\n```swift\nSiderealTime.init(julianDay: JulianDay.now)\n```\nLocal Apparent Sidereal Time:\n```swift\n// Get location from GPS or hard code\nlet locTime = ObserverLocationTime(location: location, timestamp: JulianDay.now)\nlet localSidTime = SiderealTime.init(observerLocationTime: locTime)\n```\nMore use cases can be found in the source and test cases.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjben%2Fspacetime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjben%2Fspacetime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjben%2Fspacetime/lists"}