11-09-2016 02:35 AM
hello master:
i had thought about this question and try to calculate it for two days. but i still can't get the right coordinate.
picture 1.bmp, the coordinate of point "P" and point "Q" is known.
after we rotated with 337.96289 degree, i took a picture 2.bmp, the coordinate of point "Q" in 2.bmp is known. now how can i calculate the coordinate of point "P" in 2.bmp? this problem was suffering me. it will be very appreciated for any help or suggestion. thanks.
Solved! Go to Solution.
11-09-2016 08:54 AM
11-09-2016 08:00 PM
Something like this:
Create vector from first points which is distance from Q to P: V(x,y) = P(x,y) - Q(x,y)
Create rotation matrix M using T=rotation angle: First row = cos(T) sin(T) Second row = -sin(T) cos(T).
Multiply matrix times vector: Vnew(x,y) = M[2*2] * V(x,y)
Add Vnew to Qnew to get Pnew: Pnew(x,y) = Qnew(x,y) + Vnew(x,y)
I may have negative sine in wrong position, because I didn't look it up. If the rotation is in the wrong direction, move the negative to the other sine.
Bruce
11-10-2016 02:48 AM
hi Bruce
I always use bellow vi for this reason
but as I told in my first post you can do this just when you have
position of two points in one 2d plate ot you have position of one point + rotation angle of 2d plate
with just one point it is impossible to find other point position based on that point
11-15-2016 02:52 AM
BruceAmmons 已写:Something like this:
Create vector from first points which is distance from Q to P: V(x,y) = P(x,y) - Q(x,y)
Create rotation matrix M using T=rotation angle: First row = cos(T) sin(T) Second row = -sin(T) cos(T).
Multiply matrix times vector: Vnew(x,y) = M[2*2] * V(x,y)
Add Vnew to Qnew to get Pnew: Pnew(x,y) = Qnew(x,y) + Vnew(x,y)
I may have negative sine in wrong position, because I didn't look it up. If the rotation is in the wrong direction, move the negative to the other sine.
Bruce
hello Bruce:
i had used the way you described to solve the problem before i read your reply. anyway, thank you very much for your reply. your good advise will be the light at night for new comer. thanks~
11-15-2016 02:55 AM
Hatef.fouladi 已写:hi Bruce
I always use bellow vi for this reason
but as I told in my first post you can do this just when you have
position of two points in one 2d plate ot you have position of one point + rotation angle of 2d plate
with just one point it is impossible to find other point position based on that point
hello master:
yes. i used the way which Bruse talked about. and then i used 2D Cartesian rotation.vi to finish the code. you are in the same way~ thanks for your reply.~
11-15-2016 03:22 AM
your welcome ,also you can use above vis for geometric calculation in image