Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 903573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:54:16+00:00 2026-05-15T15:54:16+00:00

I have two squares, S1 = (x1,y1,x2,y2) and S2 = (a1,b1,a2,b2) I’m looking for

  • 0

I have two squares, S1 = (x1,y1,x2,y2) and S2 = (a1,b1,a2,b2)

I’m looking for the A transformation matrix with which
A * S1 = S2

As far as I see, A is an affine 3×3 matrix, so I have 9 unknown values.

How can I calculate these values?

thanks and best,
Viktor

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:54:17+00:00Added an answer on May 15, 2026 at 3:54 pm

    A transformation matrix is a factor of scaling matrix Ss, transition matrix St and rotation matrix Sr.

    Assume the old point is Po is (Xo,Yo) and as vector will be represented as (Xo Yo 1)’ same for the new point Pn
    Then Pnv =SsStSrPov
    Where Sx is

    Sx  0    0
    0   Sy   0
    0   0    1
    

    St is

    1   0   Tx
    0   1   Ty
    0   0   1
    

    Sr is

    Cos(th)    -Sin(th)    0
    Sin(th)     Cos(th)    0
    0           0          1
    

    Now back to your question. if two point are giving to represent a rectangle we can just find the parameter of two matrix and the third one will be an identity matrix.

    Rect1 is represented as Top-Left point P11 and Bottom-Right Point P12
    Rect2 is represented as Top-Left point P21 and Bottom-Right Point P22

    S=Ss*St

    Sx  0  Tx
    0   Sy Ty
    0   0  1
    

    Now you have 4 missing parameters and 4 set of equations

    P21=S*P11
    P22=S*P12
    
    X[P21] =Sx*X[P11]+Tx
    Y[P21] =Sy*Y[P11]+Ty
    X[P22] =Sx*X[P12]+Tx
    Y[P22] =Sy*Y[P12]+Ty
    

    Solve it and you’ll get your answer.

    and if you have transition and rotation then
    S=Sr*St.

    Cos(th)    -Sin(th)    Tx
    Sin(th)     Cos(th)    Ty
    0           0          1
    

    Now you have 3 missing parameters and 4 set of equations

    P21=S*P11
    P22=S*P12
    
    X[P21] =Cos(th)*X[P11]-Sin(th)*Y[P11]+Tx
    Y[P21] =Sin(th)*X[P11]+Cos(th)*Y[P11]+Ty
    X[P22] =Cos(th)*X[P11]-Sin(th)*Y[P12]+Tx
    Y[P22] =Sin(th)*X[P11]+Cos(th)*Y[P12]+Ty
    

    Replace Cos(th) with A and Sin(th) With B and solve the equations.

    X[P21] =A*X[P11]-B*Y[P11]+Tx
    Y[P21] =B*X[P11]+A*Y[P11]+Ty
    X[P22] =A*X[P11]-B*Y[P12]+Tx
    Y[P22] =B*X[P11]+A*Y[P12]+Ty
    

    Check if its correct A^2+B^2 =? 1 if is true then th = aCos(A)

    The last part of the solution, if you’ll have all three matrixes, then S=SrStSs is

     Sx*sin(th) -Sx*cos(th)  Tx
     Sy*cos(th)  Sy*sin(th)  Ty
              0           0   1
    

    Now we have 5 missing variables and we need 6 different set of equations to solve it. which is mean 3 points from each rectangle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes (MVC view model) which inherits from one abstract base class.
I have two columns say Main and Sub . (they can be of same
So I have a 4x3 matrix where the red or blue squares are links.
I have a page that has a 4x4 grid and two squares change color
I have a set up where I have three squares, the first two are
Suppose we have a stage with two squares, like so: Suppose we'd like the
Possible Duplicate: Determine if two rectangles overlap each other? Considering I have 2 squares
I have two squares in 3D space. I want to find the x,y,z angles
I have managed to get the sum of two squares, but it still doesnt
Let's say I have a super type (Shape) and two children (like Square, Circle).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.