|
| AffineTransf () |
| Default constructor. Creates the identity transformation.
|
|
| AffineTransf (const Point< dim > &origin) |
| Constructs a new affine tranformation that simply translates the origin.
|
|
| AffineTransf (const Point< dim > &origin, real scale) |
| Constructs a new affine transformation that first applies an isotropic scaling and then translates the origin.
|
|
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 2) |
| AffineTransf (const Point< dim > &origin, const Point< dim > &axis_x) |
| Constructs a new 2D affine transformation defined by an origin and the axis_x .
|
|
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 3) |
| AffineTransf (const Point< dim > &origin, const Point< dim > &axis_x, const Point< dim > &axis_y) |
| Constructs a new 3D affine transformation defined by an origin and a couple of directions that define the xy-plane.
|
|
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 2) |
| AffineTransf (const Point< dim > &origin, const Point< dim > &axis_x, real scale_x, real scale_y) |
| Constructs a new 2D affine transformation defined by an origin , the axis_x , and an orthotropic scaling along the x- and y-axes.
|
|
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 3) |
| AffineTransf (const Point< dim > &origin, const Point< dim > &axis_x, const Point< dim > &axis_y, real scale_x, real scale_y, real scale_z) |
| Constructs a new 3D affine transformation defined by an origin , a couple of directions that define the xy-plane, and an orthotropic scaling along the x-, y, and z-axes.
|
|
| AffineTransf (const Vector< real, n_coefs > &coefs) |
| Constructs a new object through its coefficients. a new Affine Transf object.
|
|
AffineTransf< dim > | operator* (const AffineTransf< dim > &rhs) const |
| Concatenates two affine transformation to generate a new one.
|
|
AffineTransf< dim > | inverse () const |
| Inverts the current transformation.
|
|
template<typename T > |
Vector< T, dim > | transform_point (const Vector< T, dim > &point) const |
| Transforms a point from the original to the new reference system.
|
|
template<typename T > |
Vector< T, dim > | transform_vector (const Vector< T, dim > &vector) const |
| Transforms a vector from the original to the new reference system (without translation).
|
|
template<typename T > |
Tensor< T > | transform_tensor (const Tensor< T > &tensor) const |
| Transforms a (second-order symmetric) tensor from the original to the new reference system (without translation).
|
|
|
static Vector< real, n_coefs > | compute_coefs (const Point< dim > &origin, real scale) |
| Computes the coefficients of a new 2D affine transformation that translates the origin and apply an isotropic scaling.
|
|
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 3) |
static Vector< real, n_coefs > | compute_coefs (const Point< dim > &origin, const Point< dim > &axis_x=Point< dim >(numbers::one, numbers::zero, numbers::zero), const Point< dim > &axis_y=Point< dim >(numbers::zero, numbers::one, numbers::zero), real scale_x=numbers::one, real scale_y=numbers::one, real scale_z=numbers::one) |
| Computes the coefficients of a new 3D affine transformation defined by an origin , a couple of directions that define the xy-plane, and an orthotropic scaling along the x-, y, and z-axes.
|
|
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 2) |
static Vector< real, n_coefs > | compute_coefs (const Point< dim > &origin, const Point< dim > &axis_x=Point< dim >(numbers::one, numbers::zero), real scale_x=numbers::one, real scale_y=numbers::one) |
| Computes the coefficients of a new 2D affine transformation defined by an origin , the axis_x , and an orthotropic scaling along the x- and y-axes.
|
|
template<int dim>
class qugar::impl::AffineTransf< dim >
Class for representing affine transformations.
It transforms points as y = A * x + b, where x is the original point, y is the new point, b is the translation vector, and A is the transformation matrix that may be defined by rotations and scaling.
The member coefs_ stores the involved coefficients. Thus, first dim*dim values of coefs_ contain the values of the matrix A (row-wise), and the last dim values, the ones of the vector b.
- Template Parameters
-
template<int dim>
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 3)
Constructs a new 3D affine transformation defined by an origin
and a couple of directions that define the xy-plane.
It first rotates the axes and then performs the translation.
The given axis_x
and axis_y
define the xy-plane, but they may not be orthonormal vectors. Thus, the way in which the new system directions are computed is as follows: First, the axis_x
is normalized. Then, the z-axis is computed as the normalized cross-product of the normalized vector axis_x
and axis_y
. Then, the y-axis is recomputed as the cross-product between normalized vectors along the z- and the x-axes.
- Parameters
-
origin | New origin of the reference system. |
axis_x | New x-axis of the system (it will be rescaled). |
axis_y | Axis defining the xy-plane together with axis_x . It must be not parallel to axis_x . |
template<int dim>
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 2)
Constructs a new 2D affine transformation defined by an origin
, the axis_x
, and an orthotropic scaling along the x- and y-axes.
It first applies the scaling, then rotates the axes, and finally performs the translation.
The y-axis is computed by rotating axis_x
90 degrees counter-clockwise.
- Parameters
-
origin | New origin of the reference system. |
axis_x | New x-axis of the system (it will be rescaled). |
scale_x | Scaling along the new x-axis. |
scale_y | Scaling along the new y-axis. |
template<int dim>
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 3)
Constructs a new 3D affine transformation defined by an origin
, a couple of directions that define the xy-plane, and an orthotropic scaling along the x-, y, and z-axes.
It first applies the scaling, then rotates the axes, and finally performs the translation.
The given axis_x
and axis_y
define the xy-plane, but they may not be orthonormal vectors. Thus, the way in which the new system directions are computed is as follows: First, the axis_x
is normalized. Then, the z-axis is computed as the normalized cross-product of the normalized vector axis_x
and axis_y
. Then, the y-axis is recomputed as the cross-product between normalized vectors along the z- and the x-axes.
- Parameters
-
origin | New origin of the reference system. |
axis_x | New x-axis of the system (it will be rescaled). |
axis_y | Axis defining the xy-plane together with axis_x . It must be not parallel to axis_x . |
scale_x | Scaling along the new x-axis. |
scale_y | Scaling along the new y-axis. |
scale_z | Scaling along the new z-axis. |
template<int dim>
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 2)
Computes the coefficients of a new 2D affine transformation defined by an origin
, the axis_x
, and an orthotropic scaling along the x- and y-axes.
It first applies the scaling, then rotates the axes, and finally performs the translation.
The y-axis is computed by rotating axis_x
90 degrees counter-clockwise.
The scaling is performed respect to the new (rotated/translated) reference system.
- Parameters
-
origin | New origin of the reference system. |
axis_x | New x-axis of the system (it will be rescaled). |
scale_x | Scaling along the new x-axis. |
scale_y | Scaling along the new y-axis. |
template<int dim>
template<int dim_aux = dim>
requires (dim_aux == dim && dim == 3)
static Vector< real, n_coefs > qugar::impl::AffineTransf< dim >::compute_coefs |
( |
const Point< dim > & | origin, |
|
|
const Point< dim > & | axis_x = Point< dim >(numbers::one, numbers::zero, numbers::zero), |
|
|
const Point< dim > & | axis_y = Point< dim >(numbers::zero, numbers::one, numbers::zero), |
|
|
real | scale_x = numbers::one, |
|
|
real | scale_y = numbers::one, |
|
|
real | scale_z = numbers::one ) |
|
staticnodiscardprivate |
Computes the coefficients of a new 3D affine transformation defined by an origin
, a couple of directions that define the xy-plane, and an orthotropic scaling along the x-, y, and z-axes.
It first applies the scaling, then rotates the axes, and finally performs the translation.
The given axis_x
and axis_y
define the xy-plane, but they may not be orthonormal vectors. Thus, the way in which the new system directions are computed is as follows: First, the axis_x
is normalized. Then, the z-axis is computed as the normalized cross-product of the normalized vector axis_x
and axis_y
. Then, the y-axis is recomputed as the cross-product between normalized vectors along the z- and the x-axes.
The scaling is performed respect to the new (rotated/translated) reference system.
- Parameters
-
origin | New origin of the reference system. |
axis_x | New x-axis of the system (it will be rescaled). |
axis_y | Axis defining the xy-plane together with axis_x . It must be not parallel to axis_x . |
scale_x | Scaling along the new x-axis. |
scale_y | Scaling along the new y-axis. |
scale_z | Scaling along the new z-axis. |
- Returns
- Computed coefficients.