distance() documentation
Posted: Mon Feb 06, 2006 4:00 pm
I find the documentation for "distance()" to be a bit confusing. (The one I am looking at is here http://www.neuron.yale.edu/neuron/stati ... l#distance.)
It appears there are two ways one could use this function, possibly a consequence of maintaining backwards compatability.
Style 1: Reference point at root of branch
Use
to set the origin at the root of the currently accessed section. Then use
to calculate the distance from the root to the current point at position x. See SECTION 1 below.
Style 2: Reference point specified by user
Use
to set the origin at position x1 of the currently accessed section and
returns the distance between position x2 of the currently accessed section and x1. See SECTION 2 below.
A little test script to demonstrate this is:
It appears that one can "mix and match" the styles (i.e.use "distance()" to set origin and "distance(1,x2)" to set the 2nd point). But are these all the nuances to "distance()"?
It might be beneficial to users to have this documentation updated and clarified. Thanks.
Brad
It appears there are two ways one could use this function, possibly a consequence of maintaining backwards compatability.
Style 1: Reference point at root of branch
Use
Code: Select all
distance()
Code: Select all
distance(x)
Style 2: Reference point specified by user
Use
Code: Select all
distance(0,x1)
Code: Select all
distance(1,x2)
A little test script to demonstrate this is:
Code: Select all
create dend
dend {
L = 100
diam = 1
nseg = 10 // usually, it's a good idea to use an odd value of nseg, but an even value is used here for illustrative purposes
// SECTION 1
distance() // sets origin to root of currently accessed section
for i= 0,4 {
p = 0.25*i
print distance(p)
}
print ""
// SECTION 2
distance(0,0.5) // sets origin to arbitrary point of currently accessed section
for i= 0,4 {
p = 0.25*i
print distance(1,p)
}
}
It might be beneficial to users to have this documentation updated and clarified. Thanks.
Brad