Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the difference between an "transform" and an "affine transform"?

There is a function like:

CATransform3DGetAffineTransform

Returns the affine transform represented by 't'. If 't' can not be exactly represented as an affine transform the returned value is undefined.

I'm not so math-orientated, so a easy to understand description would be very nice. Wikipedia was no big help here.

like image 272
Thanks Avatar asked May 19 '09 12:05

Thanks


People also ask

How can you tell if a transformation is affine?

A map f: X → Z is an affine map if there exists a linear map mf : V → W such that mf (x − y) = f (x) − f (y) for all x, y in X.

What is the difference between Euclidean transformation and affine transformation?

In fact, coordinates in an affine geometry are defined in terms of these fundamental invariants. An Euclidean transformation, in addition to the above, also preserves lengths and angles. Since an affine (or Euclidean) transformation preserves parallelism it cannot be used to describe a pinhole projection.

What is the difference between affine and projective transformation?

A projective transformation shows how the perceived objects change as the observer's viewpoint changes. These transformations allow the creating of perspective distortion. Affine transformations are used for scaling, skewing and rotation. Graphics Mill supports both these classes of transformations.

What is not an affine transformation?

A non affine transformations is one where the parallel lines in the space are not conserved after the transformations (like perspective projections) or the mid points between lines are not conserved (for example non linear scaling along an axis).


2 Answers

Affine transformations are transformations that do not "overly distort" your geometry in the sense that:

  • points that lay on a line before still lie on a line after the transformation
  • the relative distances between points stay the same (so a square might not be square anymore, but still has equal side lengths)

So rotation and scaling are affine - projection, for example, is not.

like image 146
Tobiesque Avatar answered Nov 09 '22 23:11

Tobiesque


Affine transformations are transformations, but transformations need not be Affine. For example, a shear of the plane is not Affine because it doesn't send lines to lines.

Affine transformations are by definition those transformations that preserve ratios of distances and send lines to lines (preserving "colinearity"). In finite-dimensional Euclidean geometry, these act by a linear transformation followed by a translation i.e. x -> Ax + b where x is a vector, A is a linear transformation and b is a vector.

Affine transformations are great for changing co-ordinate systems, perhaps from one that is fairly hard to visualise back to the usual co-ordinates.

The Affine transformations you're likely to come across in practice are translations, dilation (i.e. scaling), rotation and reflection. If you're developing for iOS, say, check out the CGAffineTransform sections of the developer documentation. These will explain how to create Affine transformations using several convenience methods, and how to apply these to UIView instances with the -setTransform message.

Last, an important point about Affine transformations is that they're not commutative under composition: Applying transform T1 followed by transform T2 is in general different from applying T2 followed by T1. That is, the order in which you apply these matters.

like image 22
SK9 Avatar answered Nov 10 '22 00:11

SK9