How to get distance between point and line and get z value ( z axis)

Hi!
I have a line x and 2 point a,b. How to get distance of point to line and get (+) or (-) of value.
I tried use node Geometry.Distance but get only value.

In image, line x is above point a: distance = +205
line x is under point b: distance = -617

Thank Advance!!!

hello, you make the difference of your projected points in Z (pt.proja-pt.a)

Cordially
christian.stan

2 Likes

Hi christian

Thank you!!!

1 Like

But this is case not good
I dont know why distance very big

here is an example

Cordially
christian.stan

1 Like

Hi @manhgt214

You can use Vector.ByTwoPoints and compare their direction.
Also you can get coordinate values from vectors, so if the distance is an Height value, for example, you can use the Vector.Z node to get its value. Depending on it direction you’ll get a positive ou negative value.

2 Likes

Hi
try this script


image

you need to use “BriMohareb_23” Pakege

distance between point and line.dyn (43.7 KB)

1 Like

Thank you!!

But I think can solved with solution of Mr.Christian.

2 Likes