NetFabric.Numerics
1.0.0-beta03
Prefix Reserved
See the version list below for details.
dotnet add package NetFabric.Numerics --version 1.0.0-beta03
NuGet\Install-Package NetFabric.Numerics -Version 1.0.0-beta03
<PackageReference Include="NetFabric.Numerics" Version="1.0.0-beta03" />
paket add NetFabric.Numerics --version 1.0.0-beta03
#r "nuget: NetFabric.Numerics, 1.0.0-beta03"
// Install NetFabric.Numerics as a Cake Addin #addin nuget:?package=NetFabric.Numerics&version=1.0.0-beta03&prerelease // Install NetFabric.Numerics as a Cake Tool #tool nuget:?package=NetFabric.Numerics&version=1.0.0-beta03&prerelease
NetFabric.Numerics
NetFabric.Numerics.Angle provides strongly-typed implementations for cartesian and polar coordinates, and operations for 2D and 3D vectors and quaternions.
WARNING: NetFabric.Numerics makes use of generic math features only available in .NET 7 and C# 11. For older versions of .NET, please use NetFabric.Angle instead.
using NetFabric.Numerics;
// Create points
var point2DInteger = new Cartesian2.Point<int>(10, 20);
var point2DFloat = new Cartesian2.Point<float>(10.0f, 20.0f);
var point2DDouble = new Cartesian2.Point<double>(10.0, 20.0);
var pointPolarDegreesFloat = new Polar.Point<Degrees, float, float>(
Angle<Degrees, float>.Right, // 90 degrees azimuth
10.0f); // radius
var pointPolarRadiansDouble = new Polar.Point<Radians, double, double>(
new Angle<Radians, double>(double.Pi), // 180 degrees azimuth
10.0f); // radius
var point3DInteger = new Cartesian3.Point<int>(10, 20, 30);
var point3DFloat = new Cartesian3.Point<float>(10.0f, 20.0f, 30.0f);
var point3DDouble = new Cartesian3.Point<double>(10.0, 20.0, 30.0);
var pointSphericalDegreesFloat = new Spherical.Point<Degrees, float, float>(
Angle<Degrees, float>.Zero, // 0 degrees azimuth
Angle<Degrees, float>.Right, // 90 degrees zenith
10.0f); // 90 degrees
// Create quaternions
var quaternionFloat = new Cartesian3.Quaternion<float>(1.0f, 2.0f, 3.0f, 4.0f);
var quaternionDouble = Cartesian3.Quaternion.FromYawPitchRoll<double>(
Angle<Radians, double>.Zero, // 0 degrees yaw
Angle<Radians, double>.Zero, // 0 degrees pitch
Angle<Radians, double>.Right); // 90 degrees roll
// Perform math operations
var vector3DDouble = point3DDouble - new Cartesian3.Point<double>(1.0, 1.0, 1.0);
var point3DTransformed = point3DDouble + vector3DDouble;
// Conversions
var convertToFloatChecked = Cartesian3.Point<float>.CreateChecked(point3DDouble); // throws if value is out of range
var convertToFloatSaturated = Cartesian3.Point<float>.CreateSaturating(point3DDouble); // saturate if value is out of range
var convertToFloatTruncated = Cartesian3.Point<float>.CreateTruncating(point3DDouble); // truncate if value is out of range
Credits
The following open-source projects are used to build and test this project:
License
This project is licensed under the MIT license. See the LICENSE file for more info.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net7.0
- NetFabric.Numerics.Angle (>= 1.0.0-beta04)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on NetFabric.Numerics:
Package | Downloads |
---|---|
NetFabric.Numerics.Geography
Package Description |
|
NetFabric.Numerics.Geodesy
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-beta08 | 213 | 11/3/2023 |
1.0.0-beta07 | 87 | 10/24/2023 |
1.0.0-beta06 | 81 | 10/20/2023 |
1.0.0-beta05 | 77 | 10/20/2023 |
1.0.0-beta04 | 109 | 6/11/2023 |
1.0.0-beta03 | 81 | 6/10/2023 |
1.0.0-beta02 | 90 | 6/9/2023 |
1.0.0-beta01 | 86 | 5/23/2023 |
Add README.