All Projects → timsearle → Euclid

timsearle / Euclid

Licence: MIT license
Great-circle mathematics helper library for platforms using Swift -

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Euclid

Atlas
An extensible 3D GIS application for visualization, analysis and research.
Stars: ✭ 113 (+145.65%)
Mutual labels:  maps
ilong
轻量级跨平台瓦片地图库,大部分算法来自QMapControl,就想练手的。。。因为需要轻量级跨平台的,所以只能先用SQLite数据库。。。
Stars: ✭ 24 (-47.83%)
Mutual labels:  maps
Codeigniter3-absen-digital
Sistem Absensi Online dengan framework codeigniter 3
Stars: ✭ 33 (-28.26%)
Mutual labels:  maps
Reports.JS
Stimulsoft Reports.JS is a reporting tool for Node.js and JavaScript applications.
Stars: ✭ 33 (-28.26%)
Mutual labels:  maps
TakeASelfie
An iOS framework that uses the front camera, detects your face and takes a selfie.
Stars: ✭ 36 (-21.74%)
Mutual labels:  carthage
timetable
Bus Timetable app React Native
Stars: ✭ 61 (+32.61%)
Mutual labels:  maps
filestack-ios
Official iOS SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
Stars: ✭ 44 (-4.35%)
Mutual labels:  carthage
jpn-atlas
TopoJSONフォーマットの日本の国、都道府県、市区町村の境界データ。Japanese municipality and prefecture boundary data in topojson format.
Stars: ✭ 17 (-63.04%)
Mutual labels:  maps
trackanimation
Track Animation is a Python 2 and 3 library that provides an easy and user-adjustable way of creating visualizations from GPS data.
Stars: ✭ 74 (+60.87%)
Mutual labels:  maps
CabanasRD
No description or website provided.
Stars: ✭ 14 (-69.57%)
Mutual labels:  maps
JSONMagic
JSONMagic makes it easy to traverse and parse JSON in Swift.
Stars: ✭ 19 (-58.7%)
Mutual labels:  carthage
lib-open-swiss-maps-sdk
Android and iOS SDK to display maps and geodata of swisstopo. Owner: simonroesch, Deputy: gjn
Stars: ✭ 22 (-52.17%)
Mutual labels:  maps
check-geojson
a checker for the geojson format. goes beyond a schema, checking semantics and producing character-level warnings.
Stars: ✭ 36 (-21.74%)
Mutual labels:  maps
csgo-maps-overviews
Counter-Strike Global Offensive maps overviews generated from game files (used by the radar)
Stars: ✭ 47 (+2.17%)
Mutual labels:  maps
JHTAlertController
A custom iOS alert that replaces the stock UIAlertController. Easily style the alert to match your app. Written in Swift for iOS.
Stars: ✭ 58 (+26.09%)
Mutual labels:  carthage
BingMapsSDSToolkit
This toolkit makes it easy to use the Bing Maps Spatial Data Services (SDS) in .NET
Stars: ✭ 39 (-15.22%)
Mutual labels:  maps
MapDownloader
Map downloader based on GMap.NET
Stars: ✭ 226 (+391.3%)
Mutual labels:  maps
SwiftFCXRefresh
Pull to refresh in Swift.
Stars: ✭ 29 (-36.96%)
Mutual labels:  carthage
NumPad
Number Pad (inspired by Square)
Stars: ✭ 81 (+76.09%)
Mutual labels:  carthage
PunycodeSwift
PunycodeSwift is a pure Swift library to allows you to encode and decode punycoded strings
Stars: ✭ 19 (-58.7%)
Mutual labels:  carthage

Euclid


Carthage compatible GitHub version Build Status

Supports Swift 5.0

Euclid is a cross-platform (iOS, macOS, tvOS, watchOS) utility class written in Swift that provides convenience methods allowing the user to perform Great-Circle mathematics with ease.

Features


  • Calculates the distance between two given coordinates
  • Calculates the initial bearing when given source and destination coordinates
  • Includes toRadians() and toDegrees() helper methods as extensions on CLLocationDegrees
  • When given a start coordinate, bearing and distance to travel a destination coordinate is calculated
  • Supports bearings in the range -180 to 180 degrees and bearings in a compass range of 0 to 360 degrees
  • 100% unit test coverage
System requirements
  • Deployment target of iOS 9.0+ / macOS 10.11+ / tvOS 10.1+ / watchOS 3.1+
  • Xcode 10.0+
  • Swift 5.0+

Usage


Euclid

The key Great-Circle method provided by the library is destination and this is accessible as a static func on the Euclid class.

public static func destination(start: CLLocationCoordinate2D, distance: CLLocationDistance, bearing: Bearing) -> CLLocationCoordinate2D { } // Destination coordinate given start, distance and bearing
let calculatedDestination = Euclid.destination(start: source, distance: 100000, bearing: bearing)

Extensions on CLLocationCoordinate2D

public func distance(from coordinate: CLLocationCoordinate2D) -> CLLocationDistance { }
source.distance(from: destination) // Distance in metres

public func bearing(to coordinate: CLLocationCoordinate2D) -> CLLocationDirection { }
source.bearing(to: destination) // Bearing in range -180 - 180

public func bearing(to coordinate: CLLocationCoordinate2D) -> Bearing { }
source.compassBearing(to: destination) // Bearing in range 0 - 360

Useful constants and types

Euclid.kEarthRadiusMetres // Radius of the earth in metres used by all calculations (6371e3)

public typealias Bearing = Double // Representing a bearing in the range -180 - 180

In addition to Euclid there is an additional type of BoundingBox that can be used to represent rectangular areas on a sphere.

public struct BoundingBox : CustomStringConvertible, CustomDebugStringConvertible {
    public let lowerLeft: CLLocationCoordinate2D
    public let upperRight: CLLocationCoordinate2D
    public let diagonal: CLLocationDistance
    public let midpoint: CLLocationCoordinate2D
}

Installation


Carthage

To integrate Euclid into your Xcode project using Carthage, specify it in your Cartfile:

github "timsearle/Euclid"

Run carthage update to build the framework and drag the built Euclid.framework into your Xcode project and update your run scripts as appropriate. For additional support, please visit the Carthage documentation.

Apps using Euclid


We'd love to hear what you have used Euclid for, if you would like your app displayed here, please send a pull request!

Contributions


Currently Euclid has all the features that it was originally developed for, but the world of Euclidean geometry is far larger. If you wish to contribute to Euclid please fork the repository and send a pull request. Contributions and feature requests are always welcome, please do not hesistate to raise an issue with the appropriate label so that any contributors can see.

License


Euclid is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].