RichieZ
Diamond Member
"The formula for calculating the cosine is:
cos = ( V1 * V2 ) / ||V1|| x ||V2||
...where V2 and V2 are our vectors, the vertical bars indicate the 2-norm, and the * indicates the inner product.
Check out http://pdl.sourceforge.net/PDLdocs/Primitive.html for some help here."
The doc says:
norm
Signature: (vec(n); [o] norm(n))
Normalises a vector to unit Euclidean length
I don't understand the syntax and there are no examples.
Lets say I have a reference to a PDL vector (my $vec), coudl somebody give me an example of how to use the norm routine to normalize it?
cos = ( V1 * V2 ) / ||V1|| x ||V2||
...where V2 and V2 are our vectors, the vertical bars indicate the 2-norm, and the * indicates the inner product.
Check out http://pdl.sourceforge.net/PDLdocs/Primitive.html for some help here."
The doc says:
norm
Signature: (vec(n); [o] norm(n))
Normalises a vector to unit Euclidean length
I don't understand the syntax and there are no examples.
Lets say I have a reference to a PDL vector (my $vec), coudl somebody give me an example of how to use the norm routine to normalize it?