Class OTSGeometryUtil


  • public final class OTSGeometryUtil
    extends java.lang.Object
    Utility class for OTS geometry.

    Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    $LastChangedDate: 2015-07-16 10:20:53 +0200 (Thu, 16 Jul 2015) $, @version $Revision: 1124 $, by $Author: pknoppers $, initial version Jul 22, 2015

    Author:
    Alexander Verbraeck, Peter Knoppers, Guus Tamminga
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String printCoordinate​(java.lang.String prefix, OTSPoint3D point)
      Print one OTSPoint3D on the console.
      static java.lang.String printCoordinates​(java.lang.String prefix, OTSLine3D line, java.lang.String separator)
      Build a string description from an OTSLine3D.
      static java.lang.String printCoordinates​(java.lang.String prefix, OTSPoint3D[] points, int fromIndex, int toIndex, java.lang.String separator)
      Built a string description from part of an array of coordinates.
      static java.lang.String printCoordinates​(java.lang.String prefix, OTSPoint3D[] coordinates, java.lang.String separator)
      Build a string description from an array of coordinates.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • printCoordinate

        public static java.lang.String printCoordinate​(java.lang.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 java.lang.String printCoordinates​(java.lang.String prefix,
                                                        OTSPoint3D[] coordinates,
                                                        java.lang.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 java.lang.String printCoordinates​(java.lang.String prefix,
                                                        OTSLine3D line,
                                                        java.lang.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 java.lang.String printCoordinates​(java.lang.String prefix,
                                                        OTSPoint3D[] points,
                                                        int fromIndex,
                                                        int toIndex,
                                                        java.lang.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