Class CartesianDistCalc

    • Method Detail

      • distance

        public double distance​(Point from,
                               double toX,
                               double toY)
        Description copied from interface: DistanceCalculator
        The distance between from and Point(toX,toY).
      • distanceSquared

        private static double distanceSquared​(double fromX,
                                              double fromY,
                                              double toX,
                                              double toY)
      • distanceToLineSegment

        public double distanceToLineSegment​(Point point,
                                            double vX,
                                            double vY,
                                            double wX,
                                            double wY)
        Distance from point to a line segment formed between points 'v' and 'w'. It respects the "squared" option.
      • pointOnBearing

        public Point pointOnBearing​(Point from,
                                    double distDEG,
                                    double bearingDEG,
                                    SpatialContext ctx,
                                    Point reuse)
        Description copied from interface: DistanceCalculator
        Calculates where a destination point is given an origin (from) distance, and bearing (given in degrees -- 0-360). If reuse is given, then this method may reset() it and return it.
      • calcBoxByDistFromPt

        public Rectangle calcBoxByDistFromPt​(Point from,
                                             double distDEG,
                                             SpatialContext ctx,
                                             Rectangle reuse)
        Description copied from interface: DistanceCalculator
        Calculates the bounding box of a circle, as specified by its center point and distance.
      • calcBoxByDistFromPt_yHorizAxisDEG

        public double calcBoxByDistFromPt_yHorizAxisDEG​(Point from,
                                                        double distDEG,
                                                        SpatialContext ctx)
        Description copied from interface: DistanceCalculator
        The Y coordinate of the horizontal axis of a circle that has maximum width. On a 2D plane, this result is always from.getY() but, perhaps surprisingly, on a sphere it is going to be slightly different.
      • area

        public double area​(Rectangle rect)
      • area

        public double area​(Circle circle)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object