...Again, not a mathematician.
This project was written using VS 2019 Community Edition. C# .NET Framework 4.7.2
I have included a sample program or change the source to fit your needs.
I'm working on documenting the class so you can easily make changes as needed.