Class OtsGeometryUtil

java.lang.Object
org.opentrafficsim.core.geometry.OtsGeometryUtil

public final class OtsGeometryUtil extends Object
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 Details

    • printCoordinate

      public static String printCoordinate(String prefix, OtsPoint3d point)
      Print one OtsPoint3d on the console.
      Parameters:
      prefix - String; text to put before the output
      point - OtsPoint3d; the coordinate to print
      Returns:
      String
    • printCoordinates

      public static String printCoordinates(String prefix, OtsPoint3d[] coordinates, String separator)
      Build a string description from an array of coordinates.
      Parameters:
      prefix - String; text to put before the coordinates
      coordinates - OtsPoint3d[]; the points to print
      separator - String; prepended to each coordinate
      Returns:
      String; description of the array of coordinates
    • printCoordinates

      public static String printCoordinates(String prefix, OtsLine3d line, String separator)
      Build a string description from an OtsLine3d.
      Parameters:
      prefix - String; text to put before the coordinates
      line - OtsLine3d; the line for which to print the points
      separator - 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 output
      points - OtsPoint3d[]; the coordinates to print
      fromIndex - int; index of the first coordinate to print
      toIndex - int; one higher than the index of the last coordinate to print
      separator - String; prepended to each coordinate
      Returns:
      String; description of the selected part of the array of coordinates