SharpAstrology.West 0.1.0-preview.4

This is a prerelease version of SharpAstrology.West.
dotnet add package SharpAstrology.West --version 0.1.0-preview.4                
NuGet\Install-Package SharpAstrology.West -Version 0.1.0-preview.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SharpAstrology.West" Version="0.1.0-preview.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SharpAstrology.West --version 0.1.0-preview.4                
#r "nuget: SharpAstrology.West, 0.1.0-preview.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SharpAstrology.West as a Cake Addin
#addin nuget:?package=SharpAstrology.West&version=0.1.0-preview.4&prerelease

// Install SharpAstrology.West as a Cake Tool
#tool nuget:?package=SharpAstrology.West&version=0.1.0-preview.4&prerelease                

SharpAstrology.West

${\color{red}This \space package \space is \space still \space experimental. \space Interfaces \space can \space change \space before \space version \space 1.0.0.}$

SharpAstrology Packages

Package Version Description Licence
SharpAstrology.Base 0.10.0 Base library MIT
SharpAstrology.SwissEph 0.2.2 Ephemerides package based on SwissEphNet AGPL-3.0
SharpAstrology.HumanDesign 1.1.0 Extensions for the Human Design system MIT
SharpAstrology.HumanDesign.BlazorComponents 0.2.1 Human Design charts as Blazor components MIT
SharpAstrology.Vedic 0.1.0 Extensions for Vedic astrology systems MIT
SharpAstrology.West 0.1.0-preview.2 Extensions for western astrology systems MIT
SharpAstrology.West.BlazorComponents 0.1.0-preview.1 Western astrology charts as Blazor components MIT

Calculate aspects with defined orbits

In Western astrology, the distances between planets are assigned certain aspects. Each planet is assigned a certain range, an orbit. This package provides an OrbitBuilder to define these orbits freely.

You can use default orbits

using SharpAstrology.DataModels;
using SharpAstrology.Enums;
using SharpAstrology.Ephemerides;
using SharpAstrology.ExtensionMethods;
using SharpAstrology.Utility;


var date = new DateTime(1988, 9, 4, 1, 15, 0, DateTimeKind.Utc);
using var eph = new SwissEphemeridesService("[PATH_TO_EPHEMERIDES_FILES]").CreateContext();

// create chart
var chart = new AstrologyChart(date, eph);

// Aspects with default western orbits
var aspect = chart.AspectBetween(Planets.Sun, Planets.SouthNode);
Console.WriteLine(aspect);
// Output: Conjunction

// Use default western orbits explicitly
var orbitBuilder = OrbitBuilder.WithWesternDefaultOrbits();
var orbits = orbitBuilder.Build();
aspect = chart.AspectBetween(Planets.Sun, Planets.SouthNode, orbits);
Console.WriteLine(aspect);
// Output: Conjunction

// Change specific orbit definitions
orbitBuilder.SetRule(Aspects.Conjunction, Planets.Sun, 1);
orbitBuilder.SetRule(Aspects.Conjunction, Planets.SouthNode, 1);
orbits = orbitBuilder.Build()
aspect = chart.AspectBetween(Planets.Sun, Planets.SouthNode, orbits);
Console.WriteLine(aspect);
// Output: None

You can load orbits from json

using SharpAstrology.DataModels;
using SharpAstrology.Enums;
using SharpAstrology.Ephemerides;
using SharpAstrology.ExtensionMethods;
using SharpAstrology.Utility;


var date = new DateTime(1988, 9, 4, 1, 15, 0, DateTimeKind.Utc);
using var eph = new SwissEphemeridesService("[PATH_TO_EPHEMERIDES_FILES]")
    .CreateContext();

// create chart
var chart = new AstrologyChart(date, eph);

// Define orbits with json string
var orbitBuilder = OrbitBuilder.FromJsonString("""
{
    "conjunction": {
        "sun": 10,
        "southnode": 8,
        "moon": 10
    }
}
""");
var orbits = orbitBuilder.Build();

Console.WriteLine(chart.AspectBetween(Planets.Sun, Planets.SouthNode, orbits));
//Output: Conjunction

Console.WriteLine(chart.AspectBetween(Planets.Moon, Planets.SouthNode, orbits));
//Moon: None

// Will throw NotSupportedException, because Jupiter is not given in orbit table.
Console.WriteLine(chart.AspectBetween(Planets.Jupiter, Planets.Sun, orbits));
The structure of the json needs to look like this:
{
  "aspect": {
    "planet": 123,
    "planet": 123,
    ...
  },
  "aspect": {
    "planet": 123,
    "planet": 123,
    ...
  },
  ...
}
The mapping to the enums is listed in the table below:
Planets json Cross json Aspects json
Planets.Sun sun Cross.Asc asc Aspects.Conjunction conjunction
Planets.Moon moon Cross.Mc nc Aspects.Opposition opposition
Planets.Mercury mercury Cross.Ic ic Aspects.Square square
Planets.Venus venus Cross.Dc dc Aspects.Trine trine
Planets.Mars mars Cross.Vertex vertex Aspects.SemiSextile semisextile
Planets.Jupiter jupiter Aspects.Quincunx quincunx
Planets.Saturn saturn Aspects.Quintile quintile
Planets.Uranus uranus
Planets.Neptune neptune
Planets.Pluto pluto
Planets.NorthNode northnode
Planets.SouthNode southnode
Planets.Chiron chiron
Planets.Earth earth

Visualizing a chart

SharpAstrology offers a package that allows you to visualize your AstrologyChart via a Blazor component. See the project SharpAstrology.West.BlazorComponents.

Astro Chart

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SharpAstrology.West:

Package Downloads
SharpAstrology.West.BlazorComponents

This package provides useful Blazor components to display information of an AstrologyChart class from the SharpAstrology.Base package.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0-preview.4 57 7/14/2024
0.1.0-preview.2 44 7/11/2024