Okay, so, we've already been over this. I don't mean me and you, I mean, just, you know, me. Anyway, the method I first found to do it is as follows.

So let's establish some variables:
$LX,$ $LY,$ $SX,$ $SY,$ $PX,$ $PY$
$A,$ $B,$ $C,$ $H$
(Segment = LS, point = P, X = axis, Y = axis, ABCH = trigonometric stuff)

And now here's the method:
$A = \sqrt{(PX-LX)^2+(PY-LY)^2}$
$B = \sqrt{(LX-SX)^2+(LY-SY)^2}$
$C = \sqrt{(PX-SX)^2+(PY-SY)^2}$
$H = \sqrt{A^2 - \left(\frac{C^2 - (B^2 + A^2)}{-2B}\right)}$
And that's the answer.

Well, this method doesn't work, because it may have two points for the line + segment but when I tested it, it may only show the segment of the points but the thing extended the line to a real line when doing the testing. I mean the line-plane-realm-flune-space line. Anyway, I'm, um, asking for a new formula that actually cuts the line off at the points so if you have the point right in the direction of the segment and move it away from it, when it doesn't touch the line anymore the value actually gets higher, I guess. Also since I found out I don't know a lot of people's fancy notation I suppose you're gonna have to break it down. Anyhow I think you just have to make an adjustment to the above formula to actually get the answer for a segment instead of a line. Bye!

  • $\begingroup$ flune? What's that? $\endgroup$ – Gerry Myerson Apr 5 '19 at 12:12
  • 1
    $\begingroup$ If you had cared to read my answer to your other question, you would know. $\endgroup$ – Yves Daoust Apr 5 '19 at 12:13
  • $\begingroup$ @Yves, are you talking to me, or to YuAre? $\endgroup$ – Gerry Myerson Apr 5 '19 at 23:04
  • $\begingroup$ oh soz lol...BTW a flune is a 4D space $\endgroup$ – FireyDeath4 - YuAre A Stranger Apr 6 '19 at 4:00
  • $\begingroup$ Well now I did read your answer and since I didn't understand a bunch of things in it now you have spammed comments. Shouldn't of asked me to read your answer. Well, unless you're fine with the comments ¯_(ツ)_/¯ $\endgroup$ – FireyDeath4 - YuAre A Stranger Apr 6 '19 at 4:33

Express the position of any point on the infinite line as $\vec l + t (\vec s - \vec l)$, where $\vec l$ and $\vec s$ are the start and end point of the line segment and $t$ is a real-valued parameter. Write the point $\vec p$ as $\vec p=\vec l + t (\vec s-\vec l)+ u \vec p_\perp$, where $\vec p_\perp$ is a line orthogonal to the first line. Compute $t$ by the usual procedure, i.e., multiply both sides of this with the vector $\vec s -\vec l$. If $t<0$ reset to $t=0$ and if $t>1$ reset to $t=1$ so move the foot point to a position in the line segment. Insert that $t$ into the expression of the point on the infinite line and compute the distance to $\vec p$ by the usual Pythagorean formula.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.