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

### NAME

    dotprod() - return the dot product of two numeric vectors

### SYNOPSIS

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

### DESCRIPTION

    Returns the dot product of 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:

        a[0] * b[0] + a[1] * b[1] + ...

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

### SEE ALSO

    norm(3), distance(3), angle(3)
