VECDotProduct

C Specification

#include <revolution/mtx.h>
f32 C_VECDotProduct ( const Vec* a, const Vec* b );
f32 PSVECDotProduct ( const Vec* a, const Vec* b );

#define VECDotProduct  C_VECDotProduct // for debug build
#define VECDotProduct  PSVECDotProduct // for nondebug build

Arguments

a Pointer to first Veca is not altered by this function.
b   Pointer to second Vec.  b is not altered by this function.

Return Values

Dot product of a and b.

Description

Finds the inner product of two vectors. a and b do not need to be unit vectors and are not normalized inside this function. In order to use VECDotProduct to calculate the cosine directly, a and b must be normalized before calling this routine.

During a debug build, VECDotProduct is interpreted as C_VECDotProduct, which is a normal C language version. During a non-debug build for a Broadway processor, the paired-singles equivalent of this function, PSVECDotProduct, will be automatically substituted. You can also call C_VECDotProduct or PSVECDotProduct explicitly.

See Also

Vec, VecPtr, VECCrossProduct

Revision History

2006/03/01 Initial version.


CONFIDENTIAL