Class SphericalPoint

java.lang.Object
nl.tudelft.simulation.language.d3.SphericalPoint
All Implemented Interfaces:
Serializable

public class SphericalPoint extends Object implements Serializable
A spherical point as defined in https://mathworld.wolfram.com/SphericalCoordinates.html . Also according to ISO 31-11

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

    • SphericalPoint

      public SphericalPoint(double radius, double theta, double phi)
      constructs a new SphericalPoint.
      Parameters:
      radius - double; radius
      theta - double; theta
      phi - double; phi
  • Method Details

    • getPhi

      public double getPhi()
      Returns:
      phi
    • getRadius

      public double getRadius()
      Returns:
      radius
    • getTheta

      public double getTheta()
      Returns:
      theta
    • toCartesianPoint

      public CartesianPoint toCartesianPoint()
      converts a spherical point to a Cartesian point.
      Returns:
      the Cartesian point
    • toCartesianPoint

      public static CartesianPoint toCartesianPoint(SphericalPoint point)
      converts a spherical point to a Cartesian point.
      Parameters:
      point - SphericalPoint; the spherical point
      Returns:
      the Cartesian point
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object