DOTProduct

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > Math > Matrix functions >

DOTProduct

 

Description

 

Compute dot product ( scalar product ) of two passed arrays or matrices.

 

Syntax

 

dp = DOTProduct(Matrix_A[()], Matrix_B[()])

 

Returns

 

Number.

 

Parameters

 

Name

Type

Optional

Meaning

Matrix_1

Variable

No

Any numeric variable representing an array or a matrix

Matrix_2

Variable

No

Any numeric variable representing an array or a matrix

 

Remarks

 

Restrictions

 

The number of elements in first and second passed matrix must be the same

 

See also

 

MAT, DET

 

Examples

 

USES "Math"

 

Dim M1(3)  As Long VALUE 1, 3, -5

Dim M2(3)  As EXT  VALUE 4, -2, -1

Dim Result As EXT

 

Result = DOTProduct( M1, M2 )

 

MSGBOX 0, Result