Repository navigation
SharpMath 2.0: .NET 10, immutable geometry, cross-platform canvas renderers - #10
Merged
Merged
Conversation
Vectors, points and matrices become readonly structs with System.Numerics vocabulary, closed-form determinants and inverses, column-vector convention and tolerance-based predicates. Adds MatrixMxN, LineSegment2D, general-form Line2D, canonical Line3D and intersection results. Removes Analysis, MathHelper, FloatingNumber and the generic matrix/vector utilities.
Recursive-descent parser with variables, parse-once/evaluate-many, implicit multiplication, comma-separated arguments, scientific notation, modulo, factorial, more built-ins and per-instance ExpressionContext. Every syntax error is a ParserException with a position.
The view records the canvas on the UI thread into a display list and replays it with the Skia renderer on Avalonia's render thread.
CsCheck checks algebraic invariants of matrices, geometry and the parser. Allocation tests guard the hot paths; evaluating with a named variable no longer allocates a closure. eng/CheckCoverage.cs enforces line coverage.
…ples The perspective demo now uses the column-vector convention, LookAt and the right-handed projection. The export sample renders the README images.
Polygon.Contains caches the largest coordinate of the polygon and computes the border tolerance once per call instead of once per edge; the function sampler reuses its buffers, so rendering no longer allocates per frame.
… Linux and macOS The outdated 1.x screenshots in the repository root are replaced by the images the export sample generates in doc/images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SharpMath 2.0 is a rewrite for .NET 10 (C# 14). It is a breaking release; CHANGELOG.md lists every change and works as a migration guide from 1.x.
Highlights
SharpMath(no dependencies),SharpMath.Canvas(model + SVG),SharpMath.Canvas.Skia,SharpMath.Canvas.WinForms(GDI+),SharpMath.Canvas.Avalonia.MatrixMxN(LU),Line2Din general form,LineSegment2D, canonicalLine3D, intersection results.ExpressionContext, allocation-free evaluation, error positions.IDrawingContextwith SVG, SkiaSharp and GDI+ renderers, WinForms and Avalonia controls, PNG/SVG export.Inverse()returning the identity andPolygon ==overflowing the stack.Verification
Fixes #3
Refs #9, #5