Macro Library vector

Vector functions. Version 1.0, April 4, 2006

dotp

dotp(a,b)
dot product of vectors a and b
a,b arrays (1+ elements)

crossp

crossp(a,b)
cross product of vectors a and b
a,b arrays (3 elements). Returns array.

vecnorm

vecnorm(a)
returns magnitude of vector a
a array (1+ elements)

vecsum

vecsum(a,b)
returns sum a+b
a,b arrays same length

vecdiff

vecdiff(a,b)
returns difference a-b
a,b arrays same length

vecprod

vecprod(a,c)
returns product c*a
a array, c scalar

veccompareset

veccompareset(a,b)
a and b are both arrays of vectors, e.g. $a = array(array(1,2,3),array(3,4,5))
returns a value between 0 (no overlap) and 1 (sets are equivalent)
calculated as n(a intersect b)/max(n(a),n(b))

veccomparesamespan

veccomparesamespan(A,B)
determins if span(A) = span(B), where A is a linearly independent set.
a and b are both arrays of vectors, e.g. $A = array(array(1,2,3),array(3,4,5))
Note that if you want to use the columns of a matrix as A, you'll need to
  transpose the matrix
Returns true or false