gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
affineTransformation.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #ifndef AFFINETRANSFORMATION_H
7 #define AFFINETRANSFORMATION_H
8 
9 #include <vector>
10 
11 // compute (extended) affine transformation matrix from rotation/translation:
12 // x' = t + (I-R)*x_c + R*x
13 // where t is the translation vector, I is the identity matrix, and R is the
14 // matrix for an active intrinsic yaw-pitch-roll rotation (i.e. intrinsic
15 // z-y'-x'' rotation or extrinsinc x-y-z rotation) with counter-clockwise angles
16 template <class FLOAT>
17 bool computeAffineTransformation(const FLOAT *rc, // rotation center
18  const FLOAT *ra, // rotation angle
19  const FLOAT *tr, // translation
20  std::vector<double> &tfo); // transformation
21 
22 // compute rotation/translation from (extended) affine transformation matrix:
23 // x' = t + (I-R)*x_c + R*x
24 // where t is the translation vector, I is the identity matrix, and R is the
25 // matrix for an active intrinsic yaw-pitch-roll rotation (i.e. intrinsic
26 // z-y'-x'' rotation or extrinsinc x-y-z rotation) with counter-clockwise angles
27 template <class FLOAT>
28 bool getAffineTransformationParameters(const std::vector<double> &tfo, // trnsf.
29  FLOAT *rc, // rotation center
30  FLOAT *ra, // rotation angle
31  FLOAT *tr); // translation
32 
33 // invert affine transformation
34 bool invertAffineTransformation(const std::vector<double> &tfo,
35  std::vector<double> &newTfo);
36 
37 // initialize transformation with unitary one
38 bool setUnitAffineTransformation(std::vector<double> &tfo);
39 
40 #endif
getAffineTransformationParameters
bool getAffineTransformationParameters(const std::vector< double > &tfo, FLOAT *rc, FLOAT *ra, FLOAT *tr)
Definition: affineTransformation.cpp:75
invertAffineTransformation
bool invertAffineTransformation(const std::vector< double > &tfo, std::vector< double > &newTfo)
Definition: affineTransformation.cpp:98
computeAffineTransformation
bool computeAffineTransformation(const FLOAT *rc, const FLOAT *ra, const FLOAT *tr, std::vector< double > &tfo)
Definition: affineTransformation.cpp:14
setUnitAffineTransformation
bool setUnitAffineTransformation(std::vector< double > &tfo)
Definition: affineTransformation.cpp:111