MTMatrix
|
+---MTVector
class Vector reprents a column vector,
a matrix with n (=dimensions) rows and a single column
+(MTVector*)vectorWithDimensions:(int)dim
create a new vector
add vector v2 to this one
-(double)angleBetween:(MTVector*)v2
calculates the angle between two vectors (in degrees)
get a value for a dimension
-(id)atDim:(int)dim value:(double)v
set a value for a dimension
copy vector
same as -toString
-(id)differenceTo:(MTVector*)v2
difference between two vectors returned as a new vector
return its dimension
-(double)euklideanDistanceTo: (MTVector*)v2
euklidean distance between two vectors
length of the vector
-(double)mixedProductBy:(MTVector*)v2 and:(MTVector*)v3
mixed product between three vectors
normalize (to length 1.0)
-(double)scalarProductBy: (MTVector*)v2
scalar product between two vectors
-(id)scaleByScalar:(double)scalar
multiply with scalar (in-place!)
recreate with new dimension.
WARNING: this is destructive
returns a string describing this vector
-(id)vectorProductBy: (MTVector*)v2
vector product between two vectors, returned as a new vector