Página Principal | Lista Alfabética | Lista de Componentes | Lista de Arquivos | Componentes Membros | Arquivos Membros

Referência do Arquivo t2d.c

#include <math.h>
#include "t2d.h"

Gráfico de dependência de inclusões para t2d.c:

Include dependency graph

Vá para o código-fonte deste arquivo.

2D affine transformation module

Data:
04-Oct-2004
Autor:
Luiz F. Martha
Versão:
1.0
This package maintains a 2D transformation matrix which can be initialized as the identity matrix, and which accumulates the usual 2D transformations.

There is a function to transform a given 2D point according to the current transformation matrix.

The 2D transformations considered are scaling, translation, and rotation. There is a function for each one of these transformations. The effect of these functions is to accumulate the corresponding transformation in the current transformation matrix.

This file must be completed as part of this assignment. The points to complete are indicated by a comment of the type: **** COMPLETE AQUI: xxx ****

Revisions:

  • Report modifications here (including name and date).


#define rad(a)   ((a)*(double)0.01745329252)
typedef double Matrix2d [2][3]
 2D affine transformation matrix type

void t2dAccumulate (Matrix2d nmt)
 This function pre-multiplies the given matrix to the current transformation matrix.

void t2dTransform (double *x, double *y)
 This function transforms the given coordinates according to the current transformation matrix.

void t2dIdentity (void)
 This function sets the current transformation matrix as the identity matrix.

void t2dTranslate (double dx, double dy)
 This function accumulates a translation transformation to the current transformation matrix.

void t2dScale (double sx, double sy)
 This function accumulates a scaling transformation to the current transformation matrix.

void t2dScaleAbout (double cx, double cy, double sx, double sy)
 This function accumulates a scaling transformation to the current transformation matrix.

void t2dRotate (double angle)
 This function accumulates a rotation transformation to the current transformation matrix.

void t2dRotateAbout (double cx, double cy, double angle)
 This function accumulates a rotation transformation to the current transformation matrix.

Matrix2d mt
 Current transformation matrix.


Deinições e macros

#define rad  )     ((a)*(double)0.01745329252)
 

Definição na linha 50 do arquivo t2d.c.

Referenciado por t2dRotate().


Definições dos tipos

typedef double Matrix2d[2][3]
 

2D affine transformation matrix type

Definição na linha 55 do arquivo t2d.c.

Referenciado por t2dRotate(), t2dScale() e t2dTranslate().


Funções

void t2dAccumulate Matrix2d  nmt  )  [static]
 

This function pre-multiplies the given matrix to the current transformation matrix.

Parâmetros:
nmt - transformation matrix to accumulate (in)

Definição na linha 77 do arquivo t2d.c.

Referências mt.

Referenciado por t2dRotate(), t2dScale() e t2dTranslate().

void t2dIdentity void   ) 
 

This function sets the current transformation matrix as the identity matrix.

Definição na linha 120 do arquivo t2d.c.

Referências mt.

Referenciado por _dspMemberAtt().

void t2dRotate double  angle  ) 
 

This function accumulates a rotation transformation to the current transformation matrix.

The rotation is performed about the origin (center of rotation). The rotation angle in assumed given in degrees.

Parâmetros:
angle - rotation angle (degrees) (in)

Definição na linha 188 do arquivo t2d.c.

Referências Matrix2d, rad e t2dAccumulate().

Referenciado por _dspMemberAtt() e t2dRotateAbout().

void t2dRotateAbout double  cx,
double  cy,
double  angle
 

This function accumulates a rotation transformation to the current transformation matrix.

The rotation is performed about the given point (center of rotation). The rotation angle in assumed given in degrees.

Parâmetros:
cx - x coordinate of center of rotation (in)
cy - y coordinate of center of rotation (in)
angle - rotation angle (degrees) (in)

Definição na linha 210 do arquivo t2d.c.

Referências t2dRotate() e t2dTranslate().

void t2dScale double  sx,
double  sy
 

This function accumulates a scaling transformation to the current transformation matrix.

The scaling is performed about the origin (center of scaling).

Parâmetros:
sx - scaling parameter in x coordinate (in)
sy - scaling parameter in y coordinate (in)

Definição na linha 152 do arquivo t2d.c.

Referências Matrix2d e t2dAccumulate().

Referenciado por t2dScaleAbout().

void t2dScaleAbout double  cx,
double  cy,
double  sx,
double  sy
 

This function accumulates a scaling transformation to the current transformation matrix.

The scaling is performed about the given point (center of scaling).

Parâmetros:
cx - x coordinate of center of scaling (in)
cy - y coordinate of center of scaling (in)
sx - scaling parameter in x coordinate (in)
sy - scaling parameter in y coordinate (in)

Definição na linha 172 do arquivo t2d.c.

Referências t2dScale() e t2dTranslate().

void t2dTransform double *  x,
double *  y
 

This function transforms the given coordinates according to the current transformation matrix.

Parâmetros:
x - x coordinate of transformed point (in/out)
y - y coordinate of transformed point (in/out)

Definição na linha 107 do arquivo t2d.c.

Referências mt.

Referenciado por _dspMemberAtt().

void t2dTranslate double  dx,
double  dy
 

This function accumulates a translation transformation to the current transformation matrix.

Parâmetros:
dx - translation parameter in x coordinate (in)
dy - translation parameter in y coordinate (in)

Definição na linha 134 do arquivo t2d.c.

Referências Matrix2d e t2dAccumulate().

Referenciado por _dspMemberAtt(), t2dRotateAbout() e t2dScaleAbout().


Variáveis

Matrix2d mt [static]
 

Valor Inicial:

 {
  { 1.0, 0.0, 0.0 },
  { 0.0, 1.0, 0.0 }
 }
Current transformation matrix.

Definição na linha 59 do arquivo t2d.c.

Referenciado por t2dAccumulate(), t2dIdentity() e t2dTransform().


Gerado em Tue Oct 5 04:55:10 2004 para Trab3 por doxygen 1.3.4