Package org.locationtech.jts.jump.geom
Class CoordUtil
- java.lang.Object
-
- org.locationtech.jts.jump.geom.CoordUtil
-
public class CoordUtil extends Object
Utility functions for working with Coordinates.
-
-
Constructor Summary
Constructors Constructor Description CoordUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Point2Dadd(Point2D a, Point2D b)static org.locationtech.jts.geom.Coordinateadd(org.locationtech.jts.geom.Coordinate c1, org.locationtech.jts.geom.Coordinate c2)Adds two coordinates.static org.locationtech.jts.geom.Coordinateaverage(Collection coordinates)static org.locationtech.jts.geom.Coordinateaverage(org.locationtech.jts.geom.Coordinate c1, org.locationtech.jts.geom.Coordinate c2)Returns the average of two Coordinates.static org.locationtech.jts.geom.Coordinateclosest(Collection coordinates, org.locationtech.jts.geom.Coordinate p)static org.locationtech.jts.geom.Coordinatedivide(org.locationtech.jts.geom.Coordinate c, double d)Divides a coordinate by a scalar.static org.locationtech.jts.geom.Coordinatemultiply(double d, org.locationtech.jts.geom.Coordinate c)Multiplies a scalar and a coordinate.static Point2Dsubtract(Point2D a, Point2D b)static org.locationtech.jts.geom.Coordinatesubtract(org.locationtech.jts.geom.Coordinate c1, org.locationtech.jts.geom.Coordinate c2)Subtracts two coordinates.static org.locationtech.jts.geom.CoordinatetoCoordinate(Point2D point)static Point2DtoPoint2D(org.locationtech.jts.geom.Coordinate coordinate)
-
-
-
Method Detail
-
average
public static org.locationtech.jts.geom.Coordinate average(org.locationtech.jts.geom.Coordinate c1, org.locationtech.jts.geom.Coordinate c2)Returns the average of two Coordinates.- Parameters:
c1- one coordinatec2- another coordinate- Returns:
- a new Coordinate with the average x and average y
-
average
public static org.locationtech.jts.geom.Coordinate average(Collection coordinates)
- Parameters:
coordinates- not empty
-
closest
public static org.locationtech.jts.geom.Coordinate closest(Collection coordinates, org.locationtech.jts.geom.Coordinate p)
- Parameters:
coordinates- not empty
-
add
public static org.locationtech.jts.geom.Coordinate add(org.locationtech.jts.geom.Coordinate c1, org.locationtech.jts.geom.Coordinate c2)Adds two coordinates.- Parameters:
c1- the first coordinatec2- the second coordinate- Returns:
- a new coordinate: c1 + c2
-
subtract
public static org.locationtech.jts.geom.Coordinate subtract(org.locationtech.jts.geom.Coordinate c1, org.locationtech.jts.geom.Coordinate c2)Subtracts two coordinates.- Parameters:
c1- the first coordinatec2- the second coordinate- Returns:
- a new coordinate: c1 - c2
-
multiply
public static org.locationtech.jts.geom.Coordinate multiply(double d, org.locationtech.jts.geom.Coordinate c)Multiplies a scalar and a coordinate.- Parameters:
d- the scalarc- the coordinate- Returns:
- a new coordinate: d * c
-
divide
public static org.locationtech.jts.geom.Coordinate divide(org.locationtech.jts.geom.Coordinate c, double d)Divides a coordinate by a scalar.- Parameters:
c- the coordinated- the scalar *- Returns:
- a new coordinate: c / d
-
toCoordinate
public static org.locationtech.jts.geom.Coordinate toCoordinate(Point2D point)
-
toPoint2D
public static Point2D toPoint2D(org.locationtech.jts.geom.Coordinate coordinate)
-
-