Conversation
Added a new `Circle2D` struct to the `CSMath.Geometry` namespace, including properties for `Center` and `Radius`. Implemented constructors for initialization and a `FindIntersections` method to compute intersection points with a `Line2D`. Updated `CSMath.projitems` to include `Circle2D.cs` and added necessary `using` directives for dependencies.
Introduced the `Arc2D` struct to represent circular arcs in 2D space, including methods for line intersections and angle containment. Enhanced the `Circle2D` struct by adding XML documentation, cleaning up imports, improving the `FindIntersections` method, and adding constructor overloads for flexibility. Updated `MathHelper` with new utility methods (`IsAngleInRange`, `NormalizeAngleRadians`) and improved `FixZero` functionality. Added comprehensive unit tests for `Circle2D` in `Circle2DTests.cs` to validate constructors and intersection logic under various scenarios. Improved overall code readability and maintainability with documentation and refactoring.
Enhanced the `Arc2D` struct with the following changes: - Added XML documentation for properties and methods. - Renamed `ContainsAngleProjection` to `InAngularRange` for clarity. - Refactored `GetIntersections` to use `InAngularRange` and improve precision. - Added extensive unit tests in `Arc2DTests.cs` to validate: - Constructor behavior and property access. - Intersection logic for various scenarios, including edge cases. - `InAngularRange` functionality for points in and out of range. - Improved test coverage for wrap-around arcs, small arcs, and offset centers. - Added necessary `using` directives in test files. These changes improve code readability, maintainability, and reliability.
Added XML documentation for the `Slope` property in `Line2D.cs` and attempted to fix its implementation, though the calculation issue remains unresolved. Removed an outdated comment in `Line3D.cs`. Updated `IsAngleInRange` in `MathHelper.cs` to include a `precision` parameter with a default value of `Epsilon` and adjusted its logic to account for tolerance, improving robustness in range checks.
Added Segment2D struct with intersection logic and equality checks. Made ILine<T> properties read-only. Improved Line2D slope calculation, equality, and hash code. Enhanced LineExtensions with better type safety and documentation. Updated Arc2D and MathHelper for consistency and clarity. Included Segment2D.cs in project file.
Renamed all test methods and calls from GetIntersections to FindIntersections in Arc2DTests.cs for consistency with the updated method name.
Added XML documentation to Line2D and its members for better clarity. Implemented GetHashCode() for proper hashing. Introduced PointInLine(double lambda) to compute points along the line.
Introduced Segment3D struct in CSMath.Geometry to represent 3D line segments. Implements ILine<XYZ> and IEquatable<Segment3D>, with methods for equality, intersection, and hash code. Updated project file to include Segment3D.cs.
Introduce FromPoints and FromSegment methods to Line2D and Line3D for easier line creation from points or segments. Add XML documentation for these methods. Move GetHashCode override in Line2D without changing its logic.
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.
No description provided.