View Javadoc
1   package org.djutils.draw.curve;
2   
3   /**
4    * Additional curve properties.
5    * <p>
6    * Copyright (c) 2023-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
7    * for project information <a href="https://djutils.org" target="_blank"> https://djutils.org</a>. The DJUTILS project is
8    * distributed under a three-clause BSD-style license, which can be found at
9    * <a href="https://djutils.org/docs/license.html" target="_blank"> https://djutils.org/docs/license.html</a>.
10   * </p>
11   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
12   * @author <a href="https://www.tudelft.nl/pknoppers">Peter Knoppers</a>
13   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
14   */
15  public interface Curvature
16  {
17      /**
18       * Start curvature of this Curve2d..
19       * @return start curvature of this Curve2d.
20       */
21      double getStartCurvature();
22  
23      /**
24       * End curvature of this Curve2d..
25       * @return end curvature of this Curve2d
26       */
27      double getEndCurvature();
28  
29      /**
30       * Start radius of this Curve2d..
31       * @return start radius of this Curve2d
32       */
33      default double getStartRadius()
34      {
35          return 1.0 / getStartCurvature();
36      }
37  
38      /**
39       * End radius of this Curve2d..
40       * @return end radius of this Curve2d
41       */
42      default double getEndRadius()
43      {
44          return 1.0 / getEndCurvature();
45      }
46  
47  }