psychopy.tools.mathtools.project

psychopy.tools.mathtools.project(v0, v1, out=None, dtype=None)[source]

Project a vector onto another.

Parameters:
  • v0 (array_like) – Vector can be Nx2, Nx3, or Nx4. If a 2D array is specified, rows are treated as separate vectors.

  • v1 (array_like) – Vector to project onto v0.

  • out (ndarray, optional) – Optional output array. Must be same shape and dtype as the expected output if out was not specified.

  • dtype (dtype or str, optional) – Data type for computations can either be ‘float32’ or ‘float64’. If out is specified, the data type of out is used and this argument is ignored. If out is not provided, ‘float64’ is used by default.

Returns:

Projection of vector v0 on v1.

Return type:

ndarray or float


Back to top