# Interpolations on scatter data of fun= f(x,y,z)

**URL:** https://discourse.julialang.org/t/interpolations-on-scatter-data-of-fun-f-x-y-z/125754
**Category:** General Usage
**Tags:** interpolations
**Created:** [February 10, 2025, 4:44pm UTC](https://discourse.julialang.org/t/interpolations-on-scatter-data-of-fun-f-x-y-z/125754 "2025-02-10T16:44:12Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![JM\_Beckers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jm_beckers/32/22482_2.png) [@JM\_Beckers](https://discourse.julialang.org/u/JM_Beckers)
#### Post date: [February 10, 2025, 4:52pm UTC](https://discourse.julialang.org/t/interpolations-on-scatter-data-of-fun-f-x-y-z/125754/2 "2025-02-10T16:52:05Z")

</div>

Some tools can be found in the discussion here

> [@2D Interpolation on an irregular grid](https://discourse.julialang.org/t/2d-interpolation-on-an-irregular-grid/105247):
>
> I want to do 2D interpolation on an irregular grid. In particular, I have a function f:\mathbb R^2 \rightarrow \mathbb R, (x, y) \mapsto z. I have an irregular grid D = (x\_i, y\_i)\_i as well as the corresponding values F = (f\_i)\_i. I would like to interpolate D, F to obtain f. I have tried Dierckx, which according to the documentation supports 2D interpolation on irregular grids, but keeps giving me the following error: “No more knots can be added because the additional knot would (quasi) coi…

some of them will probably work in 3D too. You should also consider if your data are “perfect” or if they contain noise before choosing an interpolation method. With DIVAnd, you can do something like

```julia
using DIVAnd
func(x,y,z) = x .+ y.^2 .+ z
# ----Data---
x_train = 5*rand(10)
y_train = 5*rand(10)
z_train = 5*rand(10)
A = func.(x_train,y_train,z_train)
myfun=DIVAndfun((x_train,y_train,z_train),A;epsilon2=0.001)
i=1
@show A[i],myfun(x_train[i],y_train[i],z_train[i])
@show myfun(2.5,2.5,2.5)

```

---

_[View the full topic](https://discourse.julialang.org/t/interpolations-on-scatter-data-of-fun-f-x-y-z/125754)._
