dot

From DavinciWiki
Jump to: navigation, search

Description

Take dot product of input vectors

Arguments and Return Values

Parameters: Two u-by-m-by-n arrays, where each row of an input represents a vector

Return Value: A 1-by-m-by-n array giving the dot product of the input vectors

Usage

Syntax: dot(a, b)

This function groups arrays by row, so for two-dimensional inputs, it will return a column vector with the dot products of the respective rows.

Both inputs should be u-by-m-by-n numeric arrays, with each row representing a Cartesian vector and each element representing a component of that vector. Normal vectors are 3x1x1, but this function allows vectors with a different number of components, and it allows the user to input multiple vectors as an array with multiple rows.

Returns double if any input is double; float otherwise

When dot() is entered without any arguments, it prints its description, as shown below.

Examples

dv> dot()

Dot product
dot(a, b) = a1*b1 + a2*b2 + ...
This function groups arrays by row, so for two-dimensional inputs, it
 will return a column vector with the dot products of the respective rows.
S.Marshall 10-27-2008

0
dv> dot(1//2//3, 1//2//3)
14.0000000000000
dv> dot(1//2//3//4, 1//2//3//4)
30.0000000000000

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Related Functions

Recent Library Changes

Created On: 11-18-2009
Modified On: 11-18-2009

Personal tools