Vector

Vectors are tuples of floating point numbers that can have a size between 2 and 9.

=Creating Vectors= Vectors are created using the vector binding operator , (the comma). For example Creates a 9-tuple vector of the numbers 1 through 9.

=Using Vectors=

As Parameters
Vectors can be used as shape or user function parameters if you use vectorn as the type specifier, where n is a number between 2 to 9 specifying the vector length.

As Variables
There is no type specifier for variable declarations. If the expression on the right of the = is a vector then the variable is a vector, as the v9 example above shows.

In Shape Adjustments
Some shape adjustments take two or three arguments (skew, size, x, time, transform, and targeted color changes). A vector2 or vector3 can be used in these cases. The circ shape example above shows a vector2 parameter being used for a size adjustment.

In Function Arguments
Some functions take two arguments. A single vector2 can be used in the place of the two arguments. This only works for built-in functions. User functions only accept vectors for arguments when they are explicitly declared in the function parameter list.

As Function Return
None of the built-in functions currently return vectors, but user functions can if you declare the return type as vectorn.

=Vector Access Syntax= Another way to use vectors is to extract numbers or subvectors from them and use those. The syntax for accessing a number in a vector is vectorname[index], where vectorname is the name of a variable or parameter that is a vector and index is an integer expression indicating which number of the vector to get. Vectors are zero-indexed, the first element has index 0, the second has index 1, etc.

Subvector Access
A smaller vector can be extracted from a vector using the subvector access syntax: vectorname[index, length] or vectorname[index, length, stride]. length is the length of the extracted vector and stride is the spacing between extracted numbers, which defaults to 1 if you don't specify it. For example, if v9 is a 3x3 matrix in row-major order then you could extract rows and columns like so: