Package: cairo

Function cairo:matrix-init-rotate

Lambda List

cairo:matrix-init-rotate (matrix angle)

Arguments

matrix -- a cairo:matrix-t instance to initialize
angle -- a number coerced to a double float for the angle of rotation, in radians

Return Value

The initialized cairo:matrix-t instance.

Details

Initializes the matrix to a transformation that rotates by angle. The direction of rotation is defined such that positive angles rotate in the direction from the positive X axis toward the positive Y axis. With the default axis orientation of Cairo, positive angles rotate in a clockwise direction.

Examples

The cairo:with-matrix macro uses this function for initialising the matrix for a transformation that rotates.
(cairo:with-matrix (matrix (/ pi 2))
  (cairo:matrix-to-float matrix))
=> (6.123233995736766d-17 1.0d0 -1.0d0 6.123233995736766d-17 0.0d0 0.0d0)    
 

See also

2025-1-18