Command: nest::Distance

NEST HelpDesk Command Index NEST Quick Reference
Name:
nest::Distance - compute distance between node
Synopsis:
layer from_node_id to_node_id Distance -> double
layer from_pos to_node_id Distance -> double
Description:
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
Parameters:
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
Require:
HAVE_LIBNEUROSIM */
Author:
Hans E Plesser, Kittel Austvoll

See also: Displacement, GetPosition
Source:
/usr/src/packages/BUILD/nestkernel/nestmodule.cpp
NEST HelpDesk Command Index NEST Quick Reference

© 2004 The NEST Initiative