[math] Calculate distance from (3d) Segment to (3d) Segment and Vector3D

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[math] Calculate distance from (3d) Segment to (3d) Segment and Vector3D

Patrik Karlström
Hi,
first time user of math here, in more ways than one it feels. :)

I need to get the shortest distance between two segments,
not knowing the difference, I started off by using 3d Line but until I knew
why, the result was disturbing. ;)

However, the 3d Segment class is missing all sorts of methods compared to
the 3d Line class.

Does commons math provide a way around this that allows me to get the
distances I need in a simple way?

Oh, the intersection, if any, is of interest too.

/Patrik
Reply | Threaded
Open this post in threaded view
|

Re: [math] Calculate distance from (3d) Segment to (3d) Segment and Vector3D

Gilles Sadowski-2
Hello Patrik.

2020-05-28 9:39 UTC+02:00, Patrik Karlström <[hidden email]>:

> Hi,
> first time user of math here, in more ways than one it feels. :)
>
> I need to get the shortest distance between two segments,
> not knowing the difference, I started off by using 3d Line but until I knew
> why, the result was disturbing. ;)
>
> However, the 3d Segment class is missing all sorts of methods compared to
> the 3d Line class.
>
> Does commons math provide a way around this that allows me to get the
> distances I need in a simple way?
>
> Oh, the intersection, if any, is of interest too.
>
> /Patrik
>

In the upcoming version of Commons Math (v4.0), the package
"geometry" has been removed: Code has been ported to a new
library:
    https://commons.apache.org/geometry

Please have a look, and if what you need is still missing, don't
hesitate to repost (using the "[Geometry]" prefix in the subject).

Best regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [math] Calculate distance from (3d) Segment to (3d) Segment and Vector3D

Patrik Karlström-2
Thanks for the information Gilles,
I'll take a look att Geometry then.

As soon as I posted posted my question though, I got the idea of comparing
the lengths of the segments with the distance from their beginnings to the
line intersection. If longer, then the intersection is valid for the
segments.
It looks like that works for me, but I'll switch over to Geometry.

/Patrik


Den tors 28 maj 2020 kl 13:17 skrev Gilles Sadowski <[hidden email]>:

> Hello Patrik.
>
> 2020-05-28 9:39 UTC+02:00, Patrik Karlström <[hidden email]>:
> > Hi,
> > first time user of math here, in more ways than one it feels. :)
> >
> > I need to get the shortest distance between two segments,
> > not knowing the difference, I started off by using 3d Line but until I
> knew
> > why, the result was disturbing. ;)
> >
> > However, the 3d Segment class is missing all sorts of methods compared to
> > the 3d Line class.
> >
> > Does commons math provide a way around this that allows me to get the
> > distances I need in a simple way?
> >
> > Oh, the intersection, if any, is of interest too.
> >
> > /Patrik
> >
>
> In the upcoming version of Commons Math (v4.0), the package
> "geometry" has been removed: Code has been ported to a new
> library:
>     https://commons.apache.org/geometry
>
> Please have a look, and if what you need is still missing, don't
> hesitate to repost (using the "[Geometry]" prefix in the subject).
>
> Best regards,
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>