Skip to content

kanchudeep/Geomagnetism-Swift

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Geomagnetism Swift

Swift class to calculate magnetic declination, magnetic field strength, inclination etc. for any point on the earth.

Usage

// Create instance with only location and without altitude & date
let gm:Geomagnetism = Geomagnetism(longitude: 123.45678, latitude: 76.54321)
print("Declination: \(gm.declination)")

// Create a date for calculation
let dateComponents:DateComponents = DateComponents(year: 2017, month: 7, day: 1)
var date:Date = Calendar.init(identifier: .gregorian).date(from: dateComponents)!
// Update instance with altitude and date apart from location
gm.calculate(longitude: 98.76543, latitude: 12.34567, altitude: 1234, date: date)
print("Declination: \(gm.declination)")

About

Swift class to calculate magnetic declination, magnetic field strength, inclination etc. for any point on the earth

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages