I'm having some trouble with evaluation order within NIntegrate
. Here's a simple example:
pts = {{-0.2, -0.2}, {0.2, 0.2}};
NIntegrate[Nearest[pts-> "Distance", {x, y}] , {x, y} \[Element] Disk[]]
(*Nearest: The default distance does not give a real numeric distance when
applied to the point pair {x,y} and {-0.2,-0.2}.*)
Is there some way I can get the numerical integration to plug the values of x
and y
into Nearest
rather than passing the variables themselves?