Interface Directed<D extends Directed<D>>

  • Type Parameters:
    D - the Directed type
    All Known Subinterfaces:
    Ray<R,​P>
    All Known Implementing Classes:
    Ray2d, Ray3d

    public interface Directed<D extends Directed<D>>
    Directed is the interface to specify a Direction (a vector pointing in a direction without a length).

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

    Author:
    Alexander Verbraeck, Peter Knoppers
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean epsilonEquals​(D other, double epsilonCoordinate, double epsilonDirection)
      Compare this Directed with another Directed with specified tolerances in the coordinates and the angles.
      D neg()
      Return a new O with negated coordinate values.
    • Method Detail

      • neg

        D neg()
        Return a new O with negated coordinate values. Adds 180 degrees (pi radians) to the rotation(s).
        Returns:
        D; a new D with negated coordinate values and a rotation in the opposite direction
      • epsilonEquals

        boolean epsilonEquals​(D other,
                              double epsilonCoordinate,
                              double epsilonDirection)
                       throws NullPointerException,
                              IllegalArgumentException
        Compare this Directed with another Directed with specified tolerances in the coordinates and the angles.
        Parameters:
        other - D; the point to compare with
        epsilonCoordinate - double; the upper bound of difference for one of the coordinates; use Double.POSITIVE_INFINITY if you do not want to check the coordinates
        epsilonDirection - double; the upper bound of difference for the direction(s); use Double.POSITIVE_INFINITY if you do not want to check the angles
        Returns:
        boolean; true if x, y, and z are less than epsilonCoordinate apart, and rotX, rotY and rotZ are less than epsilonRotation apart, otherwise false
        Throws:
        NullPointerException - when point is null
        IllegalArgumentException - epsilonCoordinate or epsilonRotation is NaN or negative