Dierckx.jl
Dierckx.jl copied to clipboard
Partial derivatives for 2D splines
A bunch of whitespace changes are introduced by the VScode plugin, sorry about these, but hopefully these will improve readability.
The main change introduced here is the ability to compute partial derivatives of 2D splines.
julia> x = Vector{Float64}(1:4); y = Vector{Float64}(1:5); z = (x.^2) * (y.^3)'
4×5 Matrix{Float64}:
1.0 8.0 27.0 64.0 125.0
4.0 32.0 108.0 256.0 500.0
9.0 72.0 243.0 576.0 1125.0
16.0 128.0 432.0 1024.0 2000.0
julia> s = Spline2D(x, y, z);
julia> derivative(s, 1, 1, nuy=1, nux=0) # 3x^2y^2
3.000000000000028
julia> derivative(s, 1, 1, nuy=0, nux=1) # 2xy^3
1.9999999999999887
julia> derivative(s, 1, 1, nuy=1, nux=1) # 6xy^2
6.000000000000547
I've also taken the liberty to refactor the tests by introducing testsets
.
@kbarbary could you have a look at this?
Gentle bump cc @kaarthiksundar
@moelf would you mind taking a look at this?
looks fine to me but again I'm not super familiar with the code base
I've reverted the whitespace and testset changes to make this PR much easier to review. I wonder who would be the right person to approach for this?
@jishnub Tagged a new version. Sorry got busy last week.
Thanks!