Package org.djutils.draw
Interface Oriented<O extends Oriented<O>>
- Type Parameters:
O
- The Oriented type (2d or 3d)
- All Known Subinterfaces:
Oriented2d<O>
,Oriented3d<O>
- All Known Implementing Classes:
OrientedPoint3d
public interface Oriented<O extends Oriented<O>>
Oriented is an interface to indicate an object has a direction.
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
(O other, double epsilonCoordinate, double epsilonDirection) Compare this Oriented with another Oriented with specified tolerances in the coordinates and the angles.double
getDirZ()
Return the rotation around the z-axis in radians.neg()
Return a new Oriented with negated coordinate values.
-
Method Details
-
neg
O neg()Return a new Oriented with negated coordinate values. Adds 180 degrees (pi radians) to the rotation(s).- Returns:
- a new Oriented with negated coordinate values and a rotation in the opposite direction
-
getDirZ
double getDirZ()Return the rotation around the z-axis in radians.- Returns:
- the rotation around the z-axis in radians
-
epsilonEquals
Compare this Oriented with another Oriented with specified tolerances in the coordinates and the angles.- Parameters:
other
- the Oriented to compare withepsilonCoordinate
- 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:
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
is negative
-