These functions provide the (Euclidean) length of a vector, the vector cross product or angle between two vectors.

1 2 3 4 5 6 7 | ```
resolveVector(len, ...)
vectorLength(vector)
vectorCrossProduct(a, b)
angleBetweenVectors(v1, v2)
``` |

`len` |
The expected length of the vector. |

`vector, v1, v2` |
Numeric vectors of any length. |

`a, b` |
Numeric 3-vectors. |

`...` |
Elements of the vector, to be concatenated together. |

For `vectorLength`

, the Euclidean norm or length of the
specified vector, given by `sqrt(sum(vector^2))`

. For
`vectorCrossProduct`

, the vector cross product of the two specified
vectors; and for `angleBetweenVectors`

, the angle (in radians)
between the two specified vectors. The `resolveVector`

function
concatenates the values given in `...{}`

, and if the result is a
vector of length `len`

then it is returned. If not, `NULL`

is
returned.

Jon Clayden

Please cite the following reference when using TractoR in your work:

J.D. Clayden, S. MuĂ±oz Maniega, A.J. Storkey, M.D. King, M.E. Bastin & C.A. Clark (2011). TractoR: Magnetic resonance imaging and tractography with R. Journal of Statistical Software 44(8):1-18. http://www.jstatsoft.org/v44/i08/.

`crossprod`

for the matrix cross product.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.