Skip to content

Dot_product_normalised_3d

hugh greene edited this page Jun 20, 2022 · 1 revision

Description

DotProduct.png In mathematics, the dot product, or scalar product (or sometimes inner product in the context of Euclidean space), is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors) and returns a single number. This operation can be defined either algebraically or geometrically. Algebraically, it is the sum of the products of the corresponding entries of the two sequences of numbers. Geometrically, it is the product of the magnitudes of the two vectors and the cosine of the angle between them. The name "dot product" is derived from the centered dot " · " that is often used to designate this operation; the alternative name "scalar product" emphasizes the scalar (rather than vectorial) nature of the result.

This function normalises the calculation so the value returned lies between -1 and 1.

Parameters

Parameter Data Type Description
x1 double x coordinate of the first vector
y1 double y coordinate
z1 double z coordinate
x2 double x coordinate of the second vector
y2 double y coordinate
z2 double z coordinate

Return Values

double: Returns the normalised dot product of two three dimensional vectors.

Example Call

// demonstrates calculating the dot product of two vectors
dot_product_3d(0, 0, 0, 0, 0, 0);

NOTOC

Category:Function:Real

Clone this wiki locally