Package: cairo

Function cairo:matrix-init-translate

Lambda List

cairo:matrix-init-translate (matrix tx ty)

Arguments

matrix -- a cairo:matrix-t instance to initialize
tx -- a number coerced to a double float for the amount to tanslate in the x direction
ty -- a number coerced to a double float for the amount to tanslate in the y direction

Return Value

The initialized cairo:matrix-t instance.

Details

Initializes the matrix to a transformation that translates by tx and ty in the x and y dimensions, respectively.

Examples

The cairo:with-matrix macro uses this function for initialising the matrix for a translation.
(cairo:with-matrix (matrix :translate 1/2 2)
  (cairo:matrix-to-float matrix))
=> (1.0d0 0.0d0 0.0d0 1.0d0 0.5d0 2.0d0)    
 

See also

2025-1-18