Package org.djutils.draw
Interface Directed<D extends Directed<D>>
- Type Parameters:
D
- the Directed type
- All Known Subinterfaces:
Directed2d<D>
,Directed3d<D>
- All Known Implementing Classes:
DirectedPoint2d
,DirectedPoint3d
,OrientedPoint3d
,Ray2d
,Ray3d
public interface Directed<D extends Directed<D>>
Directed is the interface to specify a Direction (a vector without a length, pointing in a direction). This is not the
direction of the object as seen from the origin (0,0,0).
Copyright (c) 2020-2025 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, Wouter Schakel
-
Method Summary
Modifier and TypeMethodDescriptionboolean
epsilonEquals
(D other, double epsilonCoordinate, double epsilonDirection) Compare this Directed with another Directed with specified tolerances in the coordinates and the angles.neg()
Return a new D with negated coordinate values.
-
Method Details
-
neg
D neg()Return a new D with negated coordinate values. Adds 180 degrees (pi radians) to the rotation(s) and normalizes them.- Returns:
- a new D with negated coordinate values and a rotation in the opposite direction
-
epsilonEquals
Compare this Directed with another Directed with specified tolerances in the coordinates and the angles.- Parameters:
other
- the Directed to compare toepsilonCoordinate
- the upper bound of difference for one of the coordinates; use Double.POSITIVE_INFINITY if you do not want to check the coordinatesepsilonDirection
- 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
ifx
,y
, andz
are less thanepsilonCoordinate
apart, androtX
,rotY
androtZ
are less thanepsilonRotation
apart, otherwisefalse
- Throws:
NullPointerException
- whenother
isnull
ArithmeticException
- whenepsilonCoordinate
orepsilonRotation
isNaN
IllegalArgumentException
-epsilonCoordinate
orepsilonRotation
isnegative
-