[0.5.0] - 2026-06-14: scale-invariant parallelism, angle and rotation assertions
Minor release. Fixes the scale-dependence of the parallel check and adds an angle-between assertion and a proper-rotation matrix assertion.
Fixed
AreParallel/IsParallelToare now scale-invariant. The check compared the raw cross-product magnitude|u x v|against an absolute tolerance, so whether two vectors read as parallel depended on their length, not just their direction: the same angular deviation passed at unit scale and failed at large scale. It now compares the sine of the angle,|u x v| / (|u| |v|), against the tolerance (an angular measure), the same normalization the package already applied inIsCollinear. A zero or shorter-than-tolerance vector is still treated as parallel to any vector. Tolerances chosen for unit vectors are unchanged in meaning; tolerances applied to non-unit vectors now express an angle rather than a magnitude.
Added
Assert.That(vector).HasAngleBetweenApproximately(other, expectedRadians, tolerance)asserts the unsigned angle between two vectors (on[0, pi]) is within tolerance of an expected value. The angle is computed asatan2(|u x v|, u . v), which stays accurate across the whole range whereacosof the normalized dot product loses precision near0andpi.LinearAlgebra.AngleBetween(u, v)exposes the same computation on the framework-agnostic core.Assert.That(matrix).IsRotation(tolerance)asserts aMatrix4x4is a proper rotation: orthogonal (M * M^T = I) with determinant+1. Reflections (determinant-1) and matrices carrying translation or scale are rejected. Exposed on the core asLinearAlgebra.IsRotation.
Changed
- Bumped
PackageValidationBaselineVersionfrom0.4.2to0.4.3on both packages so ApiCompat strict-mode validates0.5.0against the most recently published baseline.