Description Usage Arguments Optional Parameters (...) Author(s) Examples
Calculates the euclidian distance between to nodes.
Optional this distance can be multiplied by a
costfactor in order to convert the distance to
cost-related value (such as time, costs, ...).
costfactor * ((x_0-x_1)^2 + (y_0-y_1)^2)^0.5
1 2 3 4 5 6 7 | getDistance(n0, n1, ...)
## S4 method for signature 'numeric,numeric'
getDistance(n0 = c(0, 0), n1, ...)
## S4 method for signature 'Node,Node'
getDistance(n0, n1, ...)
|
n0 |
an object of class |
n1 |
an object of class |
... |
Optional Parameters (See Below). |
...)getDistancenon negative Integer value for the number of digitis that has to be rounded to.
numeric Optional
Parameter. Used to transform the distance by a factor
into costs. Default is 1.
You may want to check these functions for any other optional parameters.
round called,
if the parameter digits is provided.
Dipl. Kfm. Felix Lindemann felix.lindemann@hs-neu-ulm.de
Wissenschaftlicher Mitarbeiter Kompetenzzentrum Logistik Buro ZWEI, 17
Hochschule fur angewandte Wissenschaften Fachhochschule Neu-Ulm | Neu-Ulm University Wileystr. 1
D-89231 Neu-Ulm
Phone +49(0)731-9762-1437 Web www.hs-neu-ulm.de/felix-lindemann/ http://felixlindemann.blogspot.de
1 2 3 4 5 6 | # getDistance(c(1,1),c(4,5),costfactor=1) # should result 5.
# getDistance(c(1,1),c(4,5),costfactor=2) # should result 10.
# w1 <- new("Node", x=0, y=0)
# c1 <- new("Node", x=3, y=4)
# getDistance(w1,c1) # should result 5.
# getDistance(w1,c1,costfactor=3) # should result 15.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.