User:LABoyd2/Vector from manual 150927

Vectors
A vector is a sequence of zero or more OpenSCAD values. Vectors are most commonly used to represent points in 3-space (as [x,y,z] triples), to represent lists of points, and to represent the size of a cuboid (also as an [x,y,z] triple).

A vector is written as a list of zero or more expressions, separated by commas, and enclosed in square brackets, Eg, [] or [10,20,30].

Example Output A cube with the sizes: X = 64, Y = 89, Z = 18.

Vectors selection
You can also refer to individual values in a vector with vector[number]. number starts from 0.

Example

Output The same cube as the previous example would be raised by 18 on the Z axis, since vector indices are numbered [0,1,2] for [X,Y,Z] respectively.

Matrix
A matrix is a vector of vectors.

Example

Output Define a 2D rotation matrix.