dotProduct()

Synopsis

Returns the vector dot product of two vectors .

Syntax

dotProduct ( v1 As Vector, 
             v2 As Vector ) As Number
Argument Type Description
v1 Vector The first vector .
v2 Vector The second vector .

Example 1

Intent >dotProduct(vector(1.0, 0.0, 0.0), vector(1.0, 0.0, 0.0)) 
--> 1.0

Example 2

Intent >dotProduct(vector(1.0, 0.0, 0.0), vector(0.0, 1.0, 0.0)) 
--> 0.0 

Example 3

Intent >dotProduct(vector(1.0, 1.0, 0.0), vector(1.0, 1.0, 0.0)) 
--> 2.0 

Example 4

Intent >dotProduct(vector(0.0, 2.5, 0.0), vector(0.0, 2.5, 0.0)) 
--> 6.25 

Example 5

Intent >dotProduct(vector(2.0, 2.5, 0.0), vector(1.0, 2.5, 0.0)) 
--> 8.25

Example 6

Intent >dotProduct(vector(2.0, 2.5, 1.0), vector(2.0, 2.5, 1.0)) 
--> 11.25