-
How to determine point x,y between two points?
How to determine point x,y between two points?
p.s.
Sry. I was Ok Math in school but that was long ago I completely forgot most.
-
I used equation of segment in this kind of case.
Let A and B be the initial and final Point and P be any point between A and B
then we have
P=A+t(B-A) ......(1)
where 0<=t<=1
if you have a point P(x,y), you can substitute it in equation 1 and if the value of t is between 0 and 1 ,the point (x,y) is in between the two point.
Hope it will solve your problem.
thanks
-
Totally not understand this way
I understand there is
point1 x1,y1
point2 x2,y2
should find point3's x3 y3 that is between point1 and point 2
Originally Posted by bid
I used equation of segment in this kind of case.
Let A and B be the initial and final Point and P be any point between A and B
then we have
P=A+t(B-A) ......(1)
where 0<=t<=1
if you have a point P(x,y), you can substitute it in equation 1 and if the value of t is between 0 and 1 ,the point (x,y) is in between the two point.
Hope it will solve your problem.
thanks
-
OH I got it!
It is
x3=(x1+x2)/2
y3=(y1+y2)/2
It is maybe same as u were say but it was not understandable for me.
P.S.
How to change topic state to [resolved]?
-
There is a general solution:
x = p1.x + blend * (p2.x - p1.x);
y = p1.y + blend * (p2.y - p1.y);
where blend is the percentage between the two points you want. So if you want halfway blend = 0.5
-
It seems same as what i figured to go with.
With this blend i guess it can be found any point between interval. Like 1 = 100% so if i need ~1/3 i go with 0.33
thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|