Solve 3 Points on a Line: Point C 0.5 AC from A to B

  • Thread starter Thread starter onako
  • Start date Start date
  • Tags Tags
    Line Points
onako
Messages
86
Reaction score
0
Given points A(x1, y1) and B(x2, y2), I'm supposed to derive the coordinate of the point C
which should be on the line AB (such that B is on the line segment AC), such that the distance CB is 0.5*distance AC. The point is to avoid the solution where C is on "the other side", such that A is between C and B. We should obtain the solution where B is between A and C.

Thanks
 
Physics news on Phys.org
Welcome to PF!

Hi onako! Welcome to PF! :smile:

(try using the X2 tag just above the Reply box :wink:)

Show us what you've tried, and where you're stuck, and then we'll know how to help! :smile:
 
I know the coordinates when point B is the midpoint of AC (2*x2-x1, 2*y2-y1), but here the distance BC is 0.5*distance AB. I would need coordinates expressed with this percent variable (0.5 here). Thanks
 
If O is the origin (0,0),

then express AB in terms of OA and OB.
 
tiny-tim said:
If O is the origin (0,0),

then express AB in terms of OA and OB.

I don't think this would lead to the solution.
Any other thoughts?
 
I agree with what Tiny-tim said, effectively he's trying to get you to think of this as the vector equation of a line and work it out from there. Rather than using the kinda of standard co-ordinate reasoning solution. The way I would do this is to draw a graph and using OA and OB, think of how you could find C from this.
 
The way the question is worded is probably where the problem is it's not really that clear imo.
 
onako said:
I know the coordinates when point B is the midpoint of AC (2*x2-x1, 2*y2-y1), but here the distance BC is 0.5*distance AB. I would need coordinates expressed with this percent variable (0.5 here). Thanks

Points on AB are given by (x_1+\lambda(x_2-x_1),y_1+\lambda(y_2-y_1)) where \lambda is the ratio of directed segments \overrightarrow{AC}/\overrightarrow{AB}. When \lambda=2 that gives the point you quoted with \overrightarrow{AC}/\overrightarrow{AB}=2.

Originally you said you wanted, "the solution where B is between A and C", with, "distance CB is 0.5*distanceAC". The sense of the directed segment \overrightarrow{CB} must be opposite from that of \overrightarrow{AC} to meet the first requirement, so \overrightarrow{AC}=2\overrightarrow{BC}, whence \overrightarrow{AB}=\overrightarrow{BC} and \overrightarrow{AC}/\overrightarrow{AB}=2. The point you gave is therefore the point C you originally requested, and, yes B is the midpoint of AC.

When you say in the above quote, "BC is 0.5*distance AB", this is not what you originally asked for, but if you want a formula based on \overrightarrow{BC}/\overrightarrow{AB}=-\overrightarrow{BC}/\overrightarrow{BA} then you can get that just by switching the A and B coördinates in the above formula.
 
onako said:
Given points A(x1, y1) and B(x2, y2), I'm supposed to derive the coordinate of the point C
which should be on the line AB (such that B is on the line segment AC), such that the distance CB is 0.5*distance AC. The point is to avoid the solution where C is on "the other side", such that A is between C and B. We should obtain the solution where B is between A and C.

Thanks

Ok. Let's simplify the problem.

Let A(x1), B(x2) and C(x3) be three points on a line.

Let us define the aliases:

a for x1
b for x2
c for x3

Let us define the function hmttr(a,b) as

\frac{|b - a| + b - a}{2}

hmttr(a,b) returns b - a if b >= a and 0 otherwise.

Now we can define c as:

b + \frac{ hmttr(a,b) }{2} - \frac{ hmttr(b,a) }{2}

That is, b + half of how much to the right b is from a - half of how much to the right a is from b.

Now we have:

b + \frac{ |b - a| + b - a }{4} - \frac{ |a - b| + a - b }{4}

which works out to

\frac{3b - a}{2}

or

x_{3} = \frac{3x_{2} - x_{1}}{2}

This will work regardless whether B is to the right of A or vice versa. C will always wind up on the opposite side of B from A.

Now you solve the line equation for this result to find y3 and z3.

The abs() function is the mother of logic. Using it you can implement decisional blocks in hardware without logic circuits. I have used it to compute the sign of a number.
 
Back
Top