Class CartesianPoint
java.lang.Object
org.djutils.draw.point.Point3d
nl.tudelft.simulation.language.d3.CartesianPoint
- All Implemented Interfaces:
Serializable
,org.djutils.draw.Drawable<org.djutils.draw.point.Point3d>
,org.djutils.draw.Drawable3d
,org.djutils.draw.point.Point<org.djutils.draw.point.Point3d>
public class CartesianPoint
extends org.djutils.draw.point.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:
-
Field Summary
Fields inherited from class org.djutils.draw.point.Point3d
x, y, z
-
Constructor Summary
ConstructorDescriptionCartesianPoint
(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
Modifier and TypeMethodDescriptionto2D()
returns the 2D representation of the point.converts the point to a sperical point.static SphericalPoint
toSphericalPoint
(CartesianPoint point) converts a cartesian point to a sperical point.toString()
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 Details
-
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
constructs a new CartesianPoint.- Parameters:
point2D
- Point2D; a 2D point
-
-
Method Details
-
to2D
returns the 2D representation of the point.- Returns:
- Point2D the result
-
toSphericalPoint
converts the point to a sperical point.- Returns:
- the spherical point
-
toSphericalPoint
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
- Specified by:
toString
in interfaceorg.djutils.draw.Drawable<org.djutils.draw.point.Point3d>
- Overrides:
toString
in classorg.djutils.draw.point.Point3d
-