-
Notifications
You must be signed in to change notification settings - Fork 35
Home
This project is an Astrodienst Swiss Ephemeris (http://www.astro.com/swisseph/) .Net portage from C to C# in a PCL project for cross platform usage.
Now SwissEphNet is available as a Nuget package: Install-Package SwissEphNet
Or you can download the binaries in the last release.
SwissEphNet is a Portable Class Library with support for .Net 4+, Silverlight 5, Windows Phone 8, Windows Store apps, Xamarin.Android and Xamarin.iOS.
Read FAQ for some usage informations.
SwissEphNet.SwissEph is IDisposable
so you can use it with an using
statement.
using (var sweph = new SwissEphNet.SwissEph()) {
// Use it
}
SwissEphNet is a Portable Classe Library and we don't have file access.
As Swiss Ephemeris use some data files, an event exists for loading the files required.
using (var sweph = new SwissEphNet.SwissEph()) {
sweph.OnLoadFile += (s, e) => {
// Loading file
};
// Use it
}
For more information read this page.
Our first step is to convert the C source code to C#, and provide some conversions from C like string format.
When we got a correct C conversion, we rewrite public methods to use a more .Net/C# friendly code. Using classes and structs instead of array of double, returns values instead of reference parameters, throw exception instead of reference 'serr', etc.
For this we create more classes to manage each domain (date, math, etc.) and the Sweph class federate all this classes.
The 'Swisseph' inherits from 'Sweph', and we replace each 'swe_*' methods by equivalent in 'Sweph'.
The Swiss Ephemeris Programming Interface documentation : http://www.astro.com/swisseph/swephprg.htm.
Last code source of Swiss Ephemeris from ftp://ftp.astro.ch/pub/swisseph/.
The NASA JPL resouces : http://www.jpl.nasa.gov/, http://ssd.jpl.nasa.gov/.
Minor planet names : http://www.minorplanetcenter.net/iau/lists/MPNames.html.