(****************************************************************************** ** VEC.sml ** sml ** ** Franklin Chen and Guy Blelloch ** The VEC signature used as part of the GEOMETRY signature ******************************************************************************) signature VEC = sig structure Number : NUMBER type vec type t = vec val fromSeq : Number.t Sequence.seq -> t val toSeq : t -> Number.t Sequence.seq val == : t * t -> bool val != : t * t -> bool (* the zero vector *) val zero : t (* A vector with infinity in each of its dimensions *) val infinity : t (* add two vectors *) val + : t * t -> t (* subtract two vectors *) val - : t * t -> t (* invert a vector *) val ~ : t -> t (* scale a vector by a number *) val scale : t * Number.t -> t (* The dot product of two vectors *) val dot : t * t -> Number.t (* The cross product of dim-1 vectors *) val cross : t Sequence.seq -> t (* The norm of a vector--i.e. the square root of a vector dotted with itself *) val norm : t -> Number.t val toString : t -> string end