# Interpolating INTO a square grid FROM nonsquare or nonuniform positions

**URL:** <https://discourse.julialang.org/t/interpolating-into-a-square-grid-from-nonsquare-or-nonuniform-positions/20095>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 25, 2019, 3:52pm UTC](https://discourse.julialang.org/t/interpolating-into-a-square-grid-from-nonsquare-or-nonuniform-positions/20095 "2019-01-25T15:52:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [January 25, 2019, 3:52pm UTC](https://discourse.julialang.org/t/interpolating-into-a-square-grid-from-nonsquare-or-nonuniform-positions/20095/1 "2019-01-25T15:52:41Z")

</div>

Hello,

I have a Vector Ψ that is defined on the two dimensional plane and has values at some specific positions, contained in a vector P as e.g. 2-tuples or SVector{2}. For example:

```julia
P
40492-element Array{SArray{Tuple{2},Float64,1,2},1}:
 [-2.82844, -25.773]
 [-2.58249, -25.773]
 [-2.33654, -25.773]
 [-2.09059, -25.773]
 [-1.84463, -25.773]
 ⋮
 [0.0, 25.986]
 [0.245951, 25.986]
 [0.491902, 25.986]
 [0.737854, 25.986]

Ψ = rand(Complex{Float64}, length(P) # not actual Ψ

```

Importantly, the positions defined by P are bounded in space, i.e. all positions are contained within a square of LxW.

What I want to do is interpolate the function of Ψ into a square grid of equally-spaced points.

I was looking the documentation of Interpolations.jl, but I realized that it serves to do the _opposite_, i.e. interpolate FROM a square grid TO anything else.

Is there any package that does what I want? Or, if I misunderstood, is it possible with Interpolations.jl ?

* * *

EDIT: To give more context, I am trying to interpolate from a hexagonal grid to a square grid.
