public class PointListUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static double[] |
toCoordinatesArray(Point[] points)
|
static int[] |
toIntegerArray(double[] doubles)
Converts an array of double values into an array of integer values by
casting them.
|
static Point[] |
toPointsArray(double[] coordinates)
Converts a given array of x/y coordinate values into an array of
Point s. |
static Point[] |
toPointsArray(Line[] segmentsArray,
boolean open)
|
static Line[] |
toSegmentsArray(Point[] points,
boolean close)
|
public static double[] toCoordinatesArray(Point[] points)
public static int[] toIntegerArray(double[] doubles)
doubles
- an array of doubles to convertpublic static Point[] toPointsArray(double[] coordinates)
Point
s.coordinates
- The array of coordinates.Point
s, representing the given x and y
coordinatespublic static Line[] toSegmentsArray(Point[] points, boolean close)
Point
coordinates into a sequence of
Line
segments, by creating a Line
segment for each two
adjacent points in the array. In case it is specified to close the
segment list, a Line
segment is furthermore created between the
last and the first point in the list.points
- the array of Point
s to convertclose
- a flag indicating whether a line segment will be created from
the last point in the list back to the first oneLine
segments, which is created by creating a
Line
for each two adjacent Point
s in the given
array, which includes a Line
segment between the last
point in the given array in the first one, if and only if the
parameter close is given as true
Copyright (c) 2014 itemis AG, and others. All rights reserved.