---
layout: doc
title: general / distance
---
# distance

### NAME

    distance() - return the Euclidean distance between two numeric vectors

### SYNOPSIS

    float distance( int array | float array a, int array | float array b );

### DESCRIPTION

    Returns the Euclidean distance between vectors a and b.  Both vectors
    must have the same number of elements, and each element must be an int
    or float.

    The result is:

        sqrt((b[0] - a[0]) * (b[0] - a[0]) + ...)

    If the vectors have different sizes, or if either vector contains a
    non-numeric element, an error is raised.

### SEE ALSO

    norm(3), dotprod(3), angle(3), sqrt(3)
