VectorDotProduct

Calculates the dot product of two 3-D vectors. The dot product of two unit vectors equals the cosine of the angle between them. Vectors a and b are orthogonal if, and only if, a ● b = 0. The dot product of two vectors is defined as follows:

  a = (a1, a2, a3)

  b = (b1, b2, b3)

  a ● b = a1*b1 + a2*b2 + a3*b3

Syntax

Rhino.VectorDotProduct (arrVector1, arrVector2)

Parameters

arrVector1

Required.  Array.  The first 3-D vector.

arrVector2

Required.  Array.  The second 3-D vector.

Returns

Double

The resulting dot product, if successful.

Null

On error.

Example

Dim arrVector1, arrVector2, dblDotProduct

arrVector1 = Array(1,0,0)

arrVector2 = Array(0,1,0)

dblDotProduct = Rhino.VectorDotProduct(arrVector1, arrVector2)

Rhino.Print dblDotProduct

Also See

VectorCrossProduct

VectorUnitize