Package org.opentrafficsim.core.geometry
Class OtsGeometryUtil
java.lang.Object
org.opentrafficsim.core.geometry.OtsGeometryUtil
Utility class for OTS geometry.
Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Guus Tamminga
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
printCoordinate
(String prefix, OtsPoint3d point) Print one OtsPoint3d on the console.static String
printCoordinates
(String prefix, OtsLine3d line, String separator) Build a string description from an OtsLine3d.static String
printCoordinates
(String prefix, OtsPoint3d[] points, int fromIndex, int toIndex, String separator) Built a string description from part of an array of coordinates.static String
printCoordinates
(String prefix, OtsPoint3d[] coordinates, String separator) Build a string description from an array of coordinates.
-
Method Details
-
printCoordinate
Print one OtsPoint3d on the console.- Parameters:
prefix
- String; text to put before the outputpoint
- OtsPoint3d; the coordinate to print- Returns:
- String
-
printCoordinates
Build a string description from an array of coordinates.- Parameters:
prefix
- String; text to put before the coordinatescoordinates
- OtsPoint3d[]; the points to printseparator
- String; prepended to each coordinate- Returns:
- String; description of the array of coordinates
-
printCoordinates
Build a string description from an OtsLine3d.- Parameters:
prefix
- String; text to put before the coordinatesline
- OtsLine3d; the line for which to print the pointsseparator
- String; prepended to each coordinate- Returns:
- String; description of the OtsLine3d
-
printCoordinates
public static String printCoordinates(String prefix, OtsPoint3d[] points, int fromIndex, int toIndex, String separator) Built a string description from part of an array of coordinates.- Parameters:
prefix
- String; text to put before the outputpoints
- OtsPoint3d[]; the coordinates to printfromIndex
- int; index of the first coordinate to printtoIndex
- int; one higher than the index of the last coordinate to printseparator
- String; prepended to each coordinate- Returns:
- String; description of the selected part of the array of coordinates
-