Shear and rotation

New Here ,
Apr 16, 2022 Apr 16, 2022

Copy link to clipboard

Copied

Hi alll, I’m facing an issue while retrieving the value of rotation angle and shear angle which is applied to the image.

 

///////////////////retrieving rotation angle//////////////////////////

var matrix = graphicFrame.matrix; var angle = Math.atan2(matrix.mValueB, matrix.mValueA); var rotation_angle = angle / Math.PI * 180;

/////////////////retrieving shear angle////////////////////////

var shearAngle = 180 / Math.PI * Math.atan2(matrix.mValueC, matrix.mValueD);

 

The above script will work properly only if the image has applied either rotation or shear angle.if the image has applied both rotation and shear angle in this time the above script will give wrong value. can anyone please help me to get the solution. I want to retrieve the value of shear and rotation angle using script.

TOPICS
Scripting

Views

192

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2022 Apr 17, 2022

Copy link to clipboard

Copied

Anyone please help me to get the solution. I'm facing an issue while retrieving rotation and shear angle of the image. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 18, 2022 Apr 18, 2022

Copy link to clipboard

Copied

Combined transformations are beyond my knowledge of linear algebra.  You could try asking on https://math.stackexchange.com/

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 18, 2022 Apr 18, 2022

Copy link to clipboard

Copied

LATEST

Assuming that shear is to be calculated as whatever is left after deducting “rotation from horizontal” (the result of the first equation), you’ll want to start with the difference between mValueB and mValueC. So your second equation is already wrong. Beyond that, as I said first time around, you’re talking math. Folks here are typically working artists whose high-school math, if they ever had much, is probably shot. As @femkeblanco says, go ask a geometer instead.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines