gvector:dot
List of: Scheme Extensions
Subjects: Mathematics
Contents: Kernel

Action: Gets the dot product of two gvector.

Filename: kern/kern_scm/gvec_scm.cxx

Syntax: (gvector:dot gvector1 gvector2)

Arg Types: gvector1 gvector

gvector2 gvector

Returns: real

Description: If the i, j, k components of vector a are <a1, a2, a3>, and the i, j, k components of vector b are <b1, b2, b3>, the dot product a . b is:


gvector1 = (a1 a2 a3) = a

gvector2 = (b1 b2 b3) = b

a . b
= (a1*b1 + a2*b2 + a3*b3)

a . b
= |a||b|cosq





; where q is the angle





; between a and b


The result of a dot product is a scalar value.


gvector1 specifies the first vector.


gvector2 specifies the second vector.

Example: ; gvector:dot

; Compute the dot product of two gvectors.

(gvector:dot (gvector 3 5 1) (gvector 2 4 7))

;; 33
PDF/KERN/13SCF.PDF
HTM/DATA/KERN/KERN/13SCF/0077.HTM