nest::Distance - compute distance between node
layer from_node_id to_node_id Distance -> double
layer from_pos to_node_id Distance -> double
This function returns the distance between the position of the "from_node_id"
node or the explicitly given "from_pos" position and the position of the
"to_node_id" node. Nodes must be parts of a spatial NodeCollection.
The "from" position is projected into the layer of the "to_node_id" node. If
this layer has periodic boundary conditions (EdgeWrap is true), then the
shortest distance is returned, taking into account the
periodicity. Fixed grid layers are in this case extended so that the
nodes at the edges of the layer have a distance of one grid unit when
wrapped.
Example:
/layer
<< /rows 5
/columns 4
/elements /iaf_psc_alpha
>> CreateLayer def
layer [4] Take layer [5] Take Distance
[[ 0.2 0.3 ]] layer [5] Take Distance
layer - NodeCollection for layer
from_node_id - int, node_id of node in a spatial NodeCollection
from_pos - double vector, position in layer
to_node_id - int, node_id of node in a spatial NodeCollection
Returns:
double - distance between nodes or given position and node
HAVE_LIBNEUROSIM */
Hans E Plesser, Kittel Austvoll
See also: Displacement, GetPosition
/builddir/build/BUILD/nest-simulator-3.3/nest-simulator-3.3/nestkernel/nestmodule.cpp