This vocab provides words for affine transformations of 2d vectors. It can sometimes be more suitable to use the words in this vocab, than setting up the affine transformation matrices manually.

Examples

Creates a 45 degree counter clock-wise rotation matrix and applies it to a vector:

Applies a combined scaling and translation transform to a vector:

Examples

Creates a 45 degree counter clock-wise rotation matrix and applies it to a vector:

USING: math.affine-transforms math.trig prettyprint ;
45 deg>rad <rotation> { 0 4 } a.v .

{ -2.82842712474619 2.82842712474619 }

{ -2.82842712474619 2.82842712474619 }

Applies a combined scaling and translation transform to a vector:

USING: math.affine-transforms math.trig prettyprint ;
{ 0 -5 } <translation> 1 2 <scale> a. { 4 3 } a.v .

{ 4.0 1.0 }

{ 4.0 1.0 }

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.99 x86.64 (2173, heads/master-f3ee5c5979, Sep 18 2022 13:17:51)