From 7dcb6ff6a4fd68ff091356b65ca61c54853cac3f Mon Sep 17 00:00:00 2001 From: Ashutosh Bharambe Date: Mon, 21 Oct 2024 05:12:08 +0000 Subject: [PATCH] test(BSplines): add tests for derivatives --- test/derivative_tests.jl | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/test/derivative_tests.jl b/test/derivative_tests.jl index fd9745de..c3c4ae73 100644 --- a/test/derivative_tests.jl +++ b/test/derivative_tests.jl @@ -186,6 +186,44 @@ end :Uniform, :Uniform], name = "BSpline Approx (Uniform, Uniform)") + + f3d(t) = [sin(t) cos(t); + 0.0 cos(2t)] + + t3d = 0.1:0.1:1.0 |> collect + u3d = cat(f3d.(t)...; dims = 3) + test_derivatives(BSplineInterpolation; + args = [u3d, t3d, + 2, + :Uniform, + :Uniform], + name = "BSpline Interpolation (Uniform, Uniform): AbstractArray" + ) + + test_derivatives(BSplineInterpolation; + args = [u3d, t3d, + 2, + :ArcLen, + :Average], + name = "BSpline Interpolation (Arclen, Average): AbstractArray" + ) + + test_derivatives(BSplineApprox; + args = [u3d, t3d, + 3, + 4, + :Uniform, + :Uniform], + name = "BSpline Approx (Uniform, Uniform)") + + test_derivatives(BSplineApprox; + args = [u3d, t3d, + 3, + 4, + :ArcLen, + :Average], + name = "BSpline Approx (Arclen, Average): AbstractArray" + ) end @testset "Cubic Hermite Spline" begin