@c %start of fragment @deffn Function cairo-translate (@var{cr}@tie{}@code{}) (@var{tx}@tie{}@code{}) (@var{ty}@tie{}@code{}) Modifies the current transformation matrix (CTM) by translating the user-space origin by (@var{tx}, @var{ty}). This offset is interpreted as a user-space coordinate according to the CTM in place before the new call to @code{cairo-translate}. In other words, the translation of the user-space origin takes place after any existing transformation. @table @var @item cr a cairo context @item tx amount to translate in the X direction @item ty amount to translate in the Y direction @end table @end deffn @deffn Function cairo-scale (@var{cr}@tie{}@code{}) (@var{sx}@tie{}@code{}) (@var{sy}@tie{}@code{}) Modifies the current transformation matrix (CTM) by scaling the X and Y user-space axes by @var{sx} and @var{sy} respectively. The scaling of the axes takes place after any existing transformation of user space. @table @var @item cr a cairo context @item sx scale factor for the X dimension @item sy scale factor for the Y dimension @end table @end deffn @deffn Function cairo-rotate (@var{cr}@tie{}@code{}) (@var{angle}@tie{}@code{}) Modifies the current transformation matrix (CTM) by rotating the user-space axes by @var{angle} radians. The rotation of the axes takes places after any existing transformation of user space. The rotation direction for positive angles is from the positive X axis toward the positive Y axis. @table @var @item cr a cairo context @item angle angle (in radians) by which the user-space axes will be rotated @end table @end deffn @deffn Function cairo-transform (@var{cr}@tie{}@code{}) (@var{matrix}@tie{}@code{}) Modifies the current transformation matrix (CTM) by applying @var{matrix} as an additional transformation. The new transformation of user space takes place after any existing transformation. @table @var @item cr a cairo context @item matrix a transformation to be applied to the user-space axes @end table @end deffn @deffn Function cairo-set-matrix (@var{cr}@tie{}@code{}) (@var{matrix}@tie{}@code{}) Modifies the current transformation matrix (CTM) by setting it equal to @var{matrix}. @table @var @item cr a cairo context @item matrix a transformation matrix from user space to device space @end table @end deffn @deffn Function cairo-get-matrix (@var{cr}@tie{}@code{}) (@var{matrix}@tie{}@code{}) Stores the current transformation matrix (CTM) into @var{matrix}. @table @var @item cr a cairo context @item matrix return value for the matrix @end table @end deffn @deffn Function cairo-identity-matrix (@var{cr}@tie{}@code{}) Resets the current transformation matrix (CTM) by setting it equal to the identity matrix. That is, the user-space and device-space axes will be aligned and one user-space unit will transform to one device-space unit. @table @var @item cr a cairo context @end table @end deffn @deffn Function cairo-user-to-device (@var{cr}@tie{}@code{}) @result{}@tie{} (@var{x}@tie{}@code{}) (@var{y}@tie{}@code{}) Transform a coordinate from user space to device space by multiplying the given point by the current transformation matrix (CTM). @table @var @item cr a cairo context @item x X value of coordinate (in/out parameter) @item y Y value of coordinate (in/out parameter) @end table @end deffn @deffn Function cairo-user-to-device-distance (@var{cr}@tie{}@code{}) @result{}@tie{} (@var{dx}@tie{}@code{}) (@var{dy}@tie{}@code{}) Transform a distance vector from user space to device space. This function is similar to @code{cairo-user-to-device} except that the translation components of the CTM will be ignored when transforming (@var{dx},@var{dy}). @table @var @item cr a cairo context @item dx X component of a distance vector (in/out parameter) @item dy Y component of a distance vector (in/out parameter) @end table @end deffn @deffn Function cairo-device-to-user (@var{cr}@tie{}@code{}) @result{}@tie{} (@var{x}@tie{}@code{}) (@var{y}@tie{}@code{}) Transform a coordinate from device space to user space by multiplying the given point by the inverse of the current transformation matrix (CTM). @table @var @item cr a cairo @item x X value of coordinate (in/out parameter) @item y Y value of coordinate (in/out parameter) @end table @end deffn @deffn Function cairo-device-to-user-distance (@var{cr}@tie{}@code{}) @result{}@tie{} (@var{dx}@tie{}@code{}) (@var{dy}@tie{}@code{}) Transform a distance vector from device space to user space. This function is similar to @code{cairo-device-to-user} except that the translation components of the inverse CTM will be ignored when transforming (@var{dx},@var{dy}). @table @var @item cr a cairo context @item dx X component of a distance vector (in/out parameter) @item dy Y component of a distance vector (in/out parameter) @end table @end deffn @c %end of fragment