dis()

Description:

Calculate the Euclidean distance between two vectors.

Syntax:

dis(A,B)

Note:

The function gets the true straight line distance, the Euclidean distance, between vector A and vector B in an n-dimensional space.

By default, parameter B consists all of 0 and the function calculates the Euclidean distance between vector A and the origin.

Parameter:

A/B

Vector

Option:

@a

Calculate the sum of absolute values of the differences between numbers at same positions in vector A and vector B

@m

Average out the Euclidean distance before getting its square root

Return value:

Numeric value

Example:

 

A

 

1

[2,0,-8]

 

2

[0,-9,-2]

 

3

=dis(A1,A2)

11.0

4

=dis@a(A1,A2)

17.0

5

=dis@m([0,1],[1,2])

1.0

6

=dis(A1)

8.246211251235321