Class CartesianPoint

java.lang.Object
org.djutils.draw.point.Point3d
nl.tudelft.simulation.language.d3.CartesianPoint
All Implemented Interfaces:
Serializable, Drawable<Point3d>, Drawable3d, Point<Point3d>

public class CartesianPoint extends Point3d
The Point3D class with utilities to convert to point2D where the z-axis is neglected.

Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.

Author:
Peter Jacobs
See Also:
  • Constructor Details

    • CartesianPoint

      public CartesianPoint(double x, double y, double z)
      constructs a new CartesianPoint.
      Parameters:
      x - double; x
      y - double; y
      z - double; z
    • CartesianPoint

      public CartesianPoint(double[] xyz)
      constructs a new CartesianPoint.
      Parameters:
      xyz - double[]; x,y,z
    • CartesianPoint

      public CartesianPoint(Point2D point2D)
      constructs a new CartesianPoint.
      Parameters:
      point2D - Point2D; a 2D point
  • Method Details

    • to2D

      public Point2D to2D()
      returns the 2D representation of the point.
      Returns:
      Point2D the result
    • toSphericalPoint

      public SphericalPoint toSphericalPoint()
      converts the point to a sperical point.
      Returns:
      the spherical point
    • toSphericalPoint

      public static SphericalPoint toSphericalPoint(CartesianPoint point)
      converts a cartesian point to a sperical point. See https://mathworld.wolfram.com/SphericalCoordinates.html
      Parameters:
      point - CartesianPoint; the cartesian point
      Returns:
      the spherical point
    • toString

      public String toString()
      Specified by:
      toString in interface Drawable<Point3d>
      Overrides:
      toString in class Point3d