Solve Manhattan Dist. Equation for 2D Line AB, Point C

  • Context: Undergrad 
  • Thread starter Thread starter onako
  • Start date Start date
  • Tags Tags
    Line
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
onako
Messages
86
Reaction score
0
I've derived an equation to satisfy the following:
Given two points A and B in 2D and distance t, compute the point C such that C is on the line AB, and the distance from A to C is t. Here, Euclidean distances are assumed.
Now, I want something similar; the point C is constrained to lie on the line AB, but the desired distance t needs be Manhattan distance. The absolute value terms make problems for my calculations. Any help on how to derive this is welcome.
 
Physics news on Phys.org
To clarify some things: the manhattan distace is
[tex] d_{ac}=|x_c-x_a|+|y_c-y_a|[/tex]
and constraining point C to be on AB (the final solution should have on the line order of ABC or ACB)
[tex] y_c=y_a+\frac{y_b-y_a}{x_b-x_a}(x_c-x_a).[/tex]
Here, the absolute value is the problem. Without it, I get the following:
[tex] x_c = \frac{d_{ac}}{d_{ab}}(x_b-x_a)+x_a[/tex],
where one expression I replace with the Manhattan distance between A and B. However, I'm not sure if this is correct.
Any help on this is highly appreciated.
 
Last edited: