Affine transformations and their inverse

In summary, F_{K} is a mapping that takes in (\hat{x},\hat{y}) and outputs (x,y). It can be defined using the matrices B_{K} and b_{K}. The function \hat{\phi} is given and we are told that \phi(x,y) is equal to \hat{\phi} composed with the inverse of F_{K}. However, when computing the value of \phi(x,y) directly and through composition with the inverse, there is a discrepancy due to an error in the transformation part of the code.
  • #1
hkcool
11
0
Let [itex]F_{K}: \hat{K} \to K[/itex] be defined as follows:
[tex]
F_{K}(\hat{x},\hat{y}) = B_{K}\left[\begin{array}{c}
\hat{x}\\
\hat{y}\\
\end{array}\right] + b_{K}
[/tex]

i.e. [itex]F_{K}[/itex] maps from [itex](\hat{x},\hat{y})[/itex] to [itex](x,y)[/itex]. In a more concrete sense, for this example take the following:
[tex]
B_{K} = \left[\begin{array}{cc}
1 & 0\\
1 & 1\\
\end{array}\right], \;\;\;b_{K} = \left[\begin{array}{c}
0\\
0\\
\end{array}\right]
[/tex]

Now suppose we have the function
[tex]
\hat{\phi}(\hat{x},\hat{y}) = 1 - \hat{x} - \hat{y}
[/tex]

and are given that
[tex]
\phi(x,y) = \hat{\phi} \circ F_{K}^{-1}
[/tex]

Computing [itex]F_{K}^{-1}[/itex] is easy:
[tex]
F_{K}^{-1} = B_{K}^{-1}\left(\left[\begin{array}{c}
x\\
y\\
\end{array}\right] - b_{K}\right) = \left[\begin{array}{c}
x\\
y-x\\
\end{array}\right]
[/tex]

so a direct computation of [itex]\phi(x,y)[/itex] gives:
[tex]
\phi(x,y) = 1 - x - (y-x) = 1-y
[/tex]

Consider the point [itex](x,y) = (1/2,0)[/itex]. We have [itex]\phi(1/2,0) = 1[/itex].

However, if we compute via the composition of the inverse, we have [itex]F_{K}^{-1}(1/2,0) = [1/2,-1/2]^{T}[/itex] and [itex]\hat{\phi} \circ F_{K}^{-1}(1/2,1/2) = 1 - 1/2 + 1/2 = 1[/itex].

edit: err, I figured out the error as I was typing this out and corrected it...maybe someone can delete this for me? Or I guess it can be left as an example or something

So what is the reason for this discrepancy and the error in the second way I computed it? This is a subroutine I have to implement in MATLAB and the only way I can do it is by computing the value of [itex]F_{K}^{-1}[/itex] first and then composing it with [itex]\hat{\phi}[/itex], since I can't get an analytical expression for [itex]\phi[/itex] in MATLAB...(I suppose I could but it would be much more tedious than it's worth).

I'm assuming I'm doing something extremely idiotic here, but can't for the life of me figure out what the error is...

If anyone is curious about the context: It's a finite element computation. Some info on the transformations: http://www.math.umn.edu/~sayas002/anIntro2FEM.pdf on page 28.
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
hkcool said:
Let [itex]F_{K}: \hat{K} \to K[/itex] be defined as follows:
[tex]
F_{K}(\hat{x},\hat{y}) = B_{K}\left[\begin{array}{c}
\hat{x}\\
\hat{y}\\
\end{array}\right] + b_{K}
[/tex]

i.e. [itex]F_{K}[/itex] maps from [itex](\hat{x},\hat{y})[/itex] to [itex](x,y)[/itex]. In a more concrete sense, for this example take the following:
[tex]
B_{K} = \left[\begin{array}{cc}
1 & 0\\
1 & 1\\
\end{array}\right], \;\;\;b_{K} = \left[\begin{array}{c}
0\\
0\\
\end{array}\right]
[/tex]

Now suppose we have the function
[tex]
\hat{\phi}(\hat{x},\hat{y}) = 1 - \hat{x} - \hat{y}
[/tex]

and are given that
[tex]
\phi(x,y) = \hat{\phi} \circ F_{K}^{-1}
[/tex]

Computing [itex]F_{K}^{-1}[/itex] is easy:
[tex]
F_{K}^{-1} = B_{K}^{-1}\left(\left[\begin{array}{c}
x\\
y\\
\end{array}\right] - b_{K}\right) = \left[\begin{array}{c}
x\\
y-x\\
\end{array}\right]
[/tex]

so a direct computation of [itex]\phi(x,y)[/itex] gives:
[tex]
\phi(x,y) = 1 - x - (y-x) = 1-y
[/tex]

Consider the point [itex](x,y) = (1/2,1/2)[/itex]. We have [itex]\phi(1/2,1/2) = 1/2[/itex].

However, if we compute via the composition of the inverse, we have [itex]F_{K}^{-1}(1/2,1/2) = [1/2,0]^{T}[/itex] and [itex]\hat{\phi} \circ F_{K}^{-1}(1/2,1/2) = 1 - 1/2 - 1/2 = 0[/itex].

Isn't it supposed to be

[tex]\hat{\phi}(F_K^{-1}(1/2,1/2) = \hat{\phi}(1/2,0) = 1 - 1/2 - 0 = 1/2[/tex]
 
  • #3
R136a1 said:
Isn't it supposed to be

[tex]\hat{\phi}(F_K^{-1}(1/2,1/2) = \hat{\phi}(1/2,0) = 1 - 1/2 - 0 = 1/2[/tex]

Yup. I've still got an error in my code in the transformation part, so I'm going to take a look at it and re-edit the question :/ sorry for the confusion
 

What are affine transformations and their inverse?

Affine transformations are a type of mathematical transformation that preserves parallel lines. This means that the transformed image will have the same shape and orientation as the original image, only a different size and position. An affine transformation can include translation, rotation, scaling, and shearing. The inverse of an affine transformation is the opposite transformation that will return the image to its original position and size.

What is the difference between affine transformations and other types of transformations?

Affine transformations preserve parallel lines and ratios of distances, while other transformations may not. For example, a non-affine transformation like a perspective transformation can change the shape and orientation of an image, making it look distorted.

How are affine transformations useful in computer graphics?

Affine transformations are fundamental in computer graphics because they can efficiently transform objects in 2D and 3D space. They are also used in computer animation to move and manipulate objects smoothly and realistically. Additionally, affine transformations are used in image processing to correct distortions and resize images.

Can affine transformations be combined?

Yes, affine transformations can be combined by multiplying their corresponding transformation matrices. The result is a single transformation that combines the effects of the individual transformations. This allows for more complex transformations to be achieved, such as translation followed by rotation and then scaling.

How are affine transformations calculated?

Affine transformations are calculated using transformation matrices. These matrices are composed of values that represent the different transformation operations, such as translation, rotation, and scaling. The transformation matrix is multiplied by the coordinates of the original image to obtain the coordinates of the transformed image. The inverse of the transformation matrix can be used to reverse the transformation and return the image to its original position and size.

Similar threads

  • Linear and Abstract Algebra
Replies
19
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
717
  • Linear and Abstract Algebra
Replies
1
Views
694
  • Linear and Abstract Algebra
Replies
1
Views
787
  • Linear and Abstract Algebra
Replies
3
Views
2K
  • Linear and Abstract Algebra
Replies
14
Views
1K
  • Linear and Abstract Algebra
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
20
Views
453
  • Linear and Abstract Algebra
Replies
5
Views
941
  • Linear and Abstract Algebra
Replies
9
Views
868
Back
Top