naginterfaces.library.blas.dvcos

naginterfaces.library.blas.dvcos(j, tolx, x, toly, y)[source]

dvcos computes the cosine of the angle between two real vectors.

For full information please refer to the NAG Library document for f06fa

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/f06/f06faf.html

Parameters
jint

If the vector is supplied in , should be set to . Otherwise, specifies the index of the unit vector to be used as .

tolxfloat

The value , used to determine whether is effectively zero.

If is negative, the value zero is used.

xfloat, array-like, shape

The -element vector .

tolyfloat

The value , used to determine whether is effectively zero.

If is negative, the value zero is used.

yfloat, array-like, shape

If , is not referenced. Otherwise, holds the vector .

Returns
vcosfloat

The cosine of the angle between and .

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

dvcos returns the cosine of the angle between two -element real vectors and , given by the expression

If , is taken to be the unit vector , in which case the array is not referenced.

If , the function returns ; if but , the function returns ; otherwise the value returned is in the range .