View Javadoc
1   package org.djutils.draw;
2   
3   /**
4    * Interface for objects that have a direction in 3d-space i.c. dirY (similar to tilt; measured as an angle from the positive
5    * z-direction) and dirZ (similar to pan; measured as an angle from the positive x-direction).
6    * <p>
7    * Copyright (c) 2023-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
8    * for project information <a href="https://djutils.org" target="_blank"> https://djutils.org</a>. The DJUTILS project is
9    * distributed under a three-clause BSD-style license, which can be found at
10   * <a href="https://djutils.org/docs/license.html" target="_blank"> https://djutils.org/docs/license.html</a>.
11   * <p>
12   * There are two naming conventions for phi and theta. Djutils draw uses neither to stay clear of this confusion. The angle from
13   * the positive z-axis to the projection of the direction on the x-y-plane is named <code>dirY</code>. The angle from the
14   * positive x-axis to the projection of the direction in the x-y-plane is named <code>dirZ</code>.
15   * </p>
16   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
17   * @author <a href="https://github.com/peter-knoppers">Peter Knoppers</a>
18   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
19   */
20  public interface Directed3d extends Directed
21  {
22      /**
23       * Retrieve the angle from the positive z axis to the direction. Normally these are values between [0:&pi;]. Angles &le;
24       * &pi;/2 indicate above the x-y-plane; positive slope, angles &gt; &pi;/2 indicate angles below this plane; negative slope.
25       * @return dirY
26       */
27      double getDirY();
28  
29      /**
30       * Retrieve the Direction3d.
31       * @return the direction
32       */
33      default Direction3d getDir()
34      {
35          return new Direction3d(getDirY(), getDirZ());
36      }
37  
38  }