Nuclear.MatrixLib 1.0.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Nuclear.MatrixLib --version 1.0.0
                    
NuGet\Install-Package Nuclear.MatrixLib -Version 1.0.0
                    
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="Nuclear.MatrixLib" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nuclear.MatrixLib" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Nuclear.MatrixLib" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nuclear.MatrixLib --version 1.0.0
                    
#r "nuget: Nuclear.MatrixLib, 1.0.0"
                    
#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.
#:package Nuclear.MatrixLib@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nuclear.MatrixLib&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Nuclear.MatrixLib&version=1.0.0
                    
Install as a Cake Tool

MatrixLib

MatrixLib is a C# library for performing mathematical operations on vectors and matrices. It provides classes and methods for creating, manipulating, and performing calculations with vectors and matrices.

Features

Vectors

  • Vector Class:
    • Create vectors from points or values.
    • Perform vector addition, subtraction, and scalar multiplication.
    • Calculate vector length.
    • Access vector elements using an indexer.
    • Display vector values.
  • VectorUtils Class:
    • Compute dot product and cross product of vectors.
    • Calculate the mixed product of three vectors.
    • Determine the angle between two vectors.

Matrices

  • Matrix Class:
    • Create matrices with specified dimensions or from a list of lists.
    • Perform matrix addition, subtraction, and scalar multiplication.
    • Multiply matrices.
    • Transpose matrices.
    • Calculate matrix determinants.
    • Compute the adjoint and inverse of matrices.
    • Access matrix elements using indexers.
    • Display matrix values.

Usage

Vectors

using MatrixLib;

Vector vectorA = new Vector(new List<double> { 1, 2, 3 });
Vector vectorB = new Vector(new List<double> { 4, 5, 6 });

// Vector addition
Vector result = vectorA + vectorB;
result.Display();

// Dot product
double dot = VectorUtils.DotProduct(vectorA, vectorB);
Console.WriteLine($"Dot Product: {dot}");

// Angle between vectors
Angle angle = VectorUtils.AngleBetweenVectors(vectorA, vectorB);
Console.WriteLine($"Angle: {angle.Degrees()} degrees");

Matrices

using MatrixLib;

Matrix matrixA = new Matrix(new List<List<double>>
{
    new List<double> { 1, 2 },
    new List<double> { 3, 4 }
});

Matrix matrixB = new Matrix(new List<List<double>>
{
    new List<double> { 5, 6 },
    new List<double> { 7, 8 }
});

// Matrix multiplication
Matrix result = matrixA * matrixB;
result.Display();

// Determinant
double determinant = matrixA.Determinant();
Console.WriteLine($"Determinant: {determinant}");

// Inverse
Matrix inverse = matrixA.Invert();
inverse.Display();

Requirements

  • .NET Framework or .NET Core

License

This library is licensed under the MIT License.

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0-alpha1 111 1/26/2026
1.0.0 105 1/21/2026