Dierckx.jl icon indicating copy to clipboard operation
Dierckx.jl copied to clipboard

Partial derivatives for 2D splines

Open jishnub opened this issue 2 years ago • 4 comments

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.

jishnub avatar Feb 01 '22 08:02 jishnub

@kbarbary could you have a look at this?

jishnub avatar Apr 12 '22 06:04 jishnub

Gentle bump cc @kaarthiksundar

jishnub avatar May 04 '22 07:05 jishnub

@moelf would you mind taking a look at this?

jishnub avatar Jun 17 '22 05:06 jishnub

looks fine to me but again I'm not super familiar with the code base

Moelf avatar Jun 17 '22 15:06 Moelf

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 avatar Mar 08 '23 06:03 jishnub

@jishnub Tagged a new version. Sorry got busy last week.

kaarthiksundar avatar Mar 17 '23 16:03 kaarthiksundar

Thanks!

jishnub avatar Mar 17 '23 16:03 jishnub