Reputation: 8045
suggest here are 3 points on,(x0,y0),(x1,y1),(x2,y2)
O = (x0,y0)
e1 = (x1-x0,y1-y0)
e2 = (x2-x0,y2-y0)
3 can make a new cordinate (O,e1,e2)
here's a point (x,y)
how to calculate the point location in (O,e1,e2)?please write down the formula ,thanks.
once i remember,but now i forget.
Upvotes: 0
Views: 411
Reputation: 6365
Let's call new coordinates a
and b
.
In the old coordinate system the point will be O+a*e1+b*e2
. Since it should be the same point (x,y)
, we have two linear equations:
x=Ox+a*e1x+b*e2x
y=Oy+a*e1y+b*e2y
Everything except a
and b
is known, two unknowns, two equations - solution exists if e1 and e2 are not parallel.
The system can be solved either by inversion of matrix ( (e1x,e2x) , (e1y,e2y) )
, or by expressing a
in terms of b
from the first equation and substituting it into the second one.
Upvotes: 2