In computer graphics, swizzles are a class of operations that transform vectors by rearranging components. Swizzles can also project from a vector of one dimensionality to a vector of another dimensionality, such as taking a three-dimensional vector and creating a two-dimensional or five-dimensional vector using components from the original vector. For example, if <code>A = {1,2,3,4}</code>, where the components are <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code> respectively, one could compute <code>B = A.wwxy</code>, whereupon <code>B</code> would equal <code>{4,4,1,2}</code>. Additionally, one could create a two-dimensional vector with <code>A.wx</code> or a five-dimensional vector with <code>A.xyzwx</code>. Combining vectors and swizzling can be employed in various ways. This is common in GPGPU applications.
In terms of linear algebra, this is equivalent to multiplying by a matrix whose rows are standard basis vectors. If , then swizzling as above looks like