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-2023 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CartesianPoint(double[] xyz)constructs a new CartesianPoint.CartesianPoint(double x, double y, double z)constructs a new CartesianPoint.CartesianPoint(Point2D point2D)constructs a new CartesianPoint.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Point2Dto2D()returns the 2D representation of the point.SphericalPointtoSphericalPoint()converts the point to a sperical point.static SphericalPointtoSphericalPoint(CartesianPoint point)converts a cartesian point to a sperical point.StringtoString()-
Methods inherited from class org.djutils.draw.point.Point3d
abs, closestPointOnLine, closestPointOnLine, closestPointOnLine, closestPointOnSegment, closestPointOnSegment, distance, distanceSquared, epsilonEquals, equals, fractionalPositionOnLine, getBounds, getPoints, getX, getY, getZ, hashCode, interpolate, neg, normalize, project, scale, size, toString, translate, translate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.djutils.draw.Drawable
getPointList, toString, toString
-
Methods inherited from interface org.djutils.draw.Drawable3d
getDimensions
-
-
-
-
Constructor Detail
-
CartesianPoint
public CartesianPoint(double x, double y, double z)constructs a new CartesianPoint.- Parameters:
x- double; xy- double; yz- 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 Detail
-
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
-
-