1
$\begingroup$

This is my first post on Mathematics Exchange, so I hope you'll be easy on me!

I'm trying to project points in one 2-d coordinate space into another 2-d coordinate space using a simple matrix transform (Python/Numpy code here).

By solving the matrix problem in the way indicated in that snippet, I get a 3x3 matrix. I now wish to use that matrix to project 2d points from the input space to the output space (lines 129-140 of the code).

My trouble is, given a 2d point in the input coordinates like 0, 347.04001, when I compose the point in 3x1 notation [0, 347.04001, 1] and multiply the point by my translation matrix, the point is not correctly positioned in the output space.

My question is: After I translate my input point to the output space (e.g. line 129), how should I interpret the third value of the output vector (row 3 column 1 of the output vector)? More generally, how should I interpret the values in the third row of the translation matrix? Any help others can provide on this question will be tremendously appreciated!

$\endgroup$
0
$\begingroup$

I figured out what the third row of the projected points means, and it solves this riddle!

This Wolfram's Mathword article discusses the homogenous coordinate system, which I'm using in the the script linked above to represent my 2d points. That article states:

Homogeneous coordinates (x_1,x_2,x_3) of a finite point (x,y) 
in the plane are any three numbers for which

 (x_1)/(x_3)=x  
 (x_2)/(x_3)=y 

That is to say, after projecting each of my points in lines 129-143, I receive as output a 3x1 vector such as the following (which is the result of the projection for the bottom left point):

[41.284498]
[-72.910514]
[0.999518]

I mistakenly thought this was an incorrect mapping to the desired lat, long coordinates for the bottom left, which are 41.3044, -72.9456. As the Wolfram's article states, however, I need to calculate x by using x1/x3 (41.284498/0.999518) and calculate y by using x2/x3 (-72.910514 / 0.999518), which yields the expected projection: 41.3044, -72.9456!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.