SMath is generic math library. set of static types. a different approach to math.
The library is based on Generic math available since .NET 7.
Point
Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance
Line
subelements: Ray, Line Segment
investigation: Projection, Intersection, Inclusion
Circle
subelements: Arc, Chord, Sector, Segment
investigation: Perimeter, Region, Tangent Points, Inclusion
Correlation, Variance, Covariance, Standard Deviation, Histogram
Add nuget package to your project.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SMath" Version="X.X.X" />
</ItemGroup>
</Project>
Replace 'X.X.X' with a specific version.
// double numbers
var line1 = Circle.TangentLine.FromAngle(radius: 5d, angle: double.Pi / 4d);
// float numbers
var line2 = Circle.TangentLine.FromAngle(radius: 5f, angle: float.Pi / 4f);
var tangentPoints = Circle.TangentPoint.FromPoint(radius: 2d, (4, 4));
var secantLine = Line.FromTwoPoints(tangentPoints.Value.Point1, tangentPoints.Value.Point2);
Any ideas, contributions and bug reports are welcome!
For new idea create an issue.
For bug report create an issue.
For contribution create a pull request.
Project is under MIT license.