It's available on maven central [1]. You can find the code on the Apache git repo [2] or on Github [3]. The user guide [4] gives an overview of the library along with code examples so you can get a feel for how it works. Don't hesitate to ask if you have any questions.
-Matt [1] https://mvnrepository.com/artifact/org.apache.commons/commons-geometry-euclidean [2] https://gitbox.apache.org/repos/asf?p=commons-geometry.git [3] https://github.com/apache/commons-geometry [4] https://commons.apache.org/proper/commons-geometry/userguide/index.html ________________________________ From: Patrik Karlström <pat...@trixon.se> Sent: Saturday, March 20, 2021 4:30 AM To: Commons Users List <user@commons.apache.org> Subject: Re: [math] 2D Line getOffset and natural orientation Thanks for the clarification, I would be happy to try out beta1 of commons-geometry, is there a staging repo for it? /Patrik Den fre 19 mars 2021 kl 00:29 skrev Matt Juntunen <matt.juntu...@hotmail.com >: > Hello. > > I agree that the docs are not really clear on the "natural orientation" > part there. Basically, the possible results are as follows: > > * positive - The argument lies on the right side of the calling line, > with the "right side" defined as the side on the right when looking along > the calling line in its defined direction. (This is what I believe is meant > by "natural orientation".) > * negative - The argument lies on the left side of the calling line. > * zero - The lines have points in common, meaning they intersect or > are coincident. > > On a side note, if you're writing geometric code, I would suggest trying > out the new(-ish) commons-geometry library [1]. It is a rewrite and > extension of the commons-math geometry code and, IMHO, the API is more > user-friendly. (Disclaimer: I wrote the majority of it so I am completely > biased 🙂 > > Regards, > Matt J > > [1] https://commons.apache.org/proper/commons-geometry/ > [https://avatars.githubusercontent.com/u/47359?s=400&v=4]< > https://github.com/apache/commons-geometry/blob/master/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/Line.java#L370 > > > apache/commons-geometry< > https://github.com/apache/commons-geometry/blob/master/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/Line.java#L370 > > > Apache Commons Geometry. Contribute to apache/commons-geometry development > by creating an account on GitHub. > github.com > > > ________________________________ > From: Patrik Karlström <pat...@trixon.se> > Sent: Thursday, March 18, 2021 3:42 AM > To: user@commons.apache.org <user@commons.apache.org> > Subject: Re: [math] 2D Line getOffset and natural orientation > > Oh, scratch that! > > I had three parallel lines and picked the wrong pair (and the correct > values came from another calculation). > > Still interested in "natural orientation" though. > > Den tors 18 mars 2021 kl 07:19 skrev Patrik Karlström <pat...@trixon.se>: > > > > Sometimes (50/50?) I'm getting an unexpected signum from > > org.apache.commons.math3.geometry.euclidean.twod.Line.getOffset(Line > > line). > > The absolute value itself is correct. > > > > From the javadoc: > > "The offset is 0 if both lines are the same, it is positive if the > > line is on the right side of the instance and negative if it is on the > > left side, according to its natural orientation." > > > > I suspect my problem relates to "according to its natural orientation." > > What is a natural orientation and what can I do to adapt to it, when > > to reverse my lines? If that's the case. > > > > > https://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/geometry/euclidean/twod/Line.html#getOffset(org.apache.commons.math3.geometry.euclidean.twod.Line) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org > For additional commands, e-mail: user-h...@commons.apache.org > >