>Transformation operations

# Transformation operations

## Name

Transformation operations -- Transformations which can be applied to bpaths or vpaths.

## Synopsis

 ``` ArtVpath* art_vpath_perturb (ArtVpath *src); ArtVpath* art_vpath_affine_transform (const ArtVpath *src, const double matrix); ArtBpath* art_bpath_affine_transform (const ArtBpath *src, const double matrix);```

## Description

Once vpaths and bpaths are constructed, it is possible to apply a number of transformations to these vector paths: art_vpath_perturb should not be really used by applications (but you might have to use it so...) but art_vpath_affine_transform and art_bpath_affine_transform are both widely used to apply affine transformations.

## Details

### art_vpath_perturb ()

 `ArtVpath* art_vpath_perturb (ArtVpath *src);`

Perturbs each of the points by a small random amount. This is helpful for cheating in cases when algorithms haven't attained numerical stability yet.

 src : Source vpath. Returns : Newly allocated vpath containing perturbed src.

### art_vpath_affine_transform ()

 ```ArtVpath* art_vpath_affine_transform (const ArtVpath *src, const double matrix);```

Computes the affine transform of the vpath, using matrix as the transform. matrix is stored in the same format as PostScript, ie. x' = matrix * x + matrix * y + matrix y' = matrix * x + matrix * y + matrix

 src : Source vpath to transform. matrix : Affine transform. Returns : the newly allocated vpath resulting from the transform.

### art_bpath_affine_transform ()

 ```ArtBpath* art_bpath_affine_transform (const ArtBpath *src, const double matrix);```

Affine transform the bezpath, returning a newly allocated ArtBpath (allocated using art_alloc()).

Result (x', y') = (matrix * x + matrix * y + matrix, matrix * x + matrix * y + matrix)

 src : The source ArtBpath. matrix : The affine transform. Returns : the transformed ArtBpath.