Formula for CGPointApplyAffineTransform function in iOS

I am trying to affine rotate matrix in Android based on iOS Code

iOS has two functions CGAffineTransformMakeRotation and CGPointApplyAffineTransform used for calculation

Step 1: CGAffineTransformMakeRotation();

Input: 

2.2860321998596191

Result: 
a = -0.65579550461444569, 
b = 0.75493857771840255, 
c = -0.75493857771840255, 
d = -0.65579550461444569, 
tx = 0, ty = 0

Formula: 

double A = Math.cos(RadiansRotated);

double B = -Math.sin(RadiansRotated);

double C = Math.sin(RadiansRotated);

double D = Math.cos(RadiansRotated);

I am able to calculate a,b,c,d for step 1 using above formula

Step 2: CGPointApplyAffineTransform()

Input : 

x = 612.55191924649432, 
y = -391.95960729287646
And Matrix return from Step 1

Result: 
x = -105.80336653205421, 
y = 719.48442314773808

Does anyone know the formula used in ApplyAffineTransform?

I need help for Step 2

I have tried with Android's Matrix class - Not Working

I have also tried with Java's AffineTransform - Not working

Answers


The math behind the CGAffineTransform functions is described in “The Math Behind the Matrices” in the Quartz 2D Programming Guide.

The formulae for transforming a point using an affine transform are given as:

x' = ax + cy + tx y' = bx + dy + ty

Incidentally, in your step 1, you have reversed the signs of b and c, which has the effect of reversing the direction of rotation.


Need Your Help

Creating a good-looking SplitView in UWP

c# uwp splitview

I followed a tutorial for adding a SplitView control to my page. The code looks like:

Is is possible to suppress the automatic time stamp in an Ant property file?

ant netbeans-7

When I compile my project in Netbeans, I want to automatically generate a file that includes a build number that automatically increments and date, so I added the following to my projects build.xm...