View Javadoc
1   package demo;
2   
3   import org.djutils.draw.line.Ray2d;
4   import org.djutils.draw.point.Point2d;
5   
6   /**
7    * RayDemos.java.
8    * <p>
9    * Copyright (c) 2021-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10   * BSD-style license. See <a href="https://djutils.org/docs/current/djutils/licenses.html">DJUTILS License</a>.
11   * </p>
12   * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
13   * @author <a href="https://www.tudelft.nl/pknoppers">Peter Knoppers</a>
14   */
15  public final class RayDemos
16  {
17      /**
18       * Do not instantiate.
19       */
20      private RayDemos()
21      {
22          // Do not instantiate.
23      }
24      
25      /**
26       * Demonstrate the Ray classes.
27       * @param args String[]; the command line arguments (not used)
28       */
29      public static void main(final String[] args)
30      {
31          Ray2d r1 = new Ray2d(new Point2d(1, 2), new Point2d(1, 6));
32          System.out.println(r1);
33          Ray2d r2 = new Ray2d(1, 2, 1, 6);
34          System.out.println(r2);
35          Ray2d r3 = new Ray2d(new Point2d(1, 2), 1, 6);
36          System.out.println(r3);
37          Ray2d r4 = new Ray2d(1, 2, new Point2d(1, 6));
38          System.out.println(r4);
39          Ray2d r5 = new Ray2d(1, 2, Math.PI / 2);
40          System.out.println(r5);
41          Ray2d r6 = new Ray2d(new Point2d(1, 2), Math.PI / 2);
42          System.out.println(r6);
43          
44      }
45  }
46