You are viewing an older version (2.4.3). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / linalg / vecdot

_ArrayFunctionDispatcher

numpy.linalg:vecdot

source: /numpy/linalg/_linalg.py :3611

Signature

def   vecdot ( x1 x2 / axis = -1 )

Summary

Computes the vector dot product.

Extended Summary

This function is restricted to arguments compatible with the Array API, contrary to numpy.vecdot.

Let be a vector in x1 and be a corresponding vector in x2. The dot product is defined as:

over the dimension specified by axis and where denotes the complex conjugate if is complex and the identity otherwise.

Parameters

x1 : array_like

First input array.

x2 : array_like

Second input array.

axis : int, optional

Axis over which to compute the dot product. Default: -1.

Returns

output : ndarray

The vector dot product of the input.

Examples

Get the projected size along a given normal for an array of vectors.
v = np.array([[0., 5., 0.], [0., 0., 10.], [0., 6., 8.]])
n = np.array([0., 0.6, 0.8])
np.linalg.vecdot(v, n)

See also

numpy.vecdot

Aliases

  • numpy.linalg.vecdot

Referenced by