public class OTSPoint3D extends Object implements Locatable, Serializable
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-07-16 10:20:53 +0200 (Thu, 16 Jul 2015) $, @version $Revision: 1124 $, by $Author: pknoppers $,
initial version Jul 22, 2015
Modifier and Type | Field and Description |
---|---|
double |
x
The internal representation of the point; x-coordinate.
|
double |
y
The internal representation of the point; y-coordinate.
|
double |
z
The internal representation of the point; z-coordinate.
|
Constructor and Description |
---|
OTSPoint3D(CartesianPoint point) |
OTSPoint3D(com.vividsolutions.jts.geom.Coordinate coordinate) |
OTSPoint3D(DirectedPoint point) |
OTSPoint3D(double[] xyz) |
OTSPoint3D(double x,
double y)
The x and y in the point are assumed to be in meters relative to an origin.
|
OTSPoint3D(double x,
double y,
double z)
The x, y and z in the point are assumed to be in meters relative to an origin.
|
OTSPoint3D(OTSPoint3D point) |
OTSPoint3D(com.vividsolutions.jts.geom.Point point) |
OTSPoint3D(Point2D point2d) |
OTSPoint3D(javax.vecmath.Point3d point) |
Modifier and Type | Method and Description |
---|---|
static List<OTSPoint3D> |
circleCenter(OTSPoint3D point1,
OTSPoint3D point2,
double radius)
Return the possible center points of a circle when two points and a radius are given.
|
static List<OTSPoint3D> |
circleIntersections(OTSPoint3D center1,
double radius1,
OTSPoint3D center2,
double radius2)
Return the possible intersections between two circles.
|
OTSPoint3D |
closestPointOnLine(OTSLine3D line)
Return the closest point on an OTSLine3D.
|
OTSPoint3D |
closestPointOnLine2D(OTSLine3D line)
Return the closest point on an OTSLine3D.
|
OTSPoint3D |
closestPointOnSegment(OTSPoint3D segmentPoint1,
OTSPoint3D segmentPoint2)
Project a point on a line segment (2D - Z-component is ignored).
|
Length |
distance(OTSPoint3D point) |
double |
distanceSI(OTSPoint3D point) |
boolean |
equals(Object obj) |
javax.media.j3d.Bounds |
getBounds()
This method returns a sphere with a diameter of half a meter as the default bounds for a point.
|
com.vividsolutions.jts.geom.Coordinate |
getCoordinate() |
DirectedPoint |
getDirectedPoint() |
DirectedPoint |
getLocation() |
Point2D |
getPoint2D() |
int |
hashCode() |
Length |
horizontalDistance(OTSPoint3D point) |
double |
horizontalDistanceSI(OTSPoint3D point) |
static OTSPoint3D |
interpolate(double ratio,
OTSPoint3D zeroValue,
OTSPoint3D oneValue)
Interpolate (or extrapolate) between (outside) two given points.
|
static OTSPoint3D |
intersectionOfLines(OTSPoint3D line1P1,
OTSPoint3D line1P2,
OTSPoint3D line2P1,
OTSPoint3D line2P2)
Compute the 2D intersection of two infinite lines.
|
static OTSPoint3D |
intersectionOfLinesDumb(OTSPoint3D line1P1,
OTSPoint3D line1P2,
OTSPoint3D line2P1,
OTSPoint3D line2P2)
Deprecated.
|
static OTSPoint3D |
intersectionOfLineSegments(OTSPoint3D line1P1,
OTSPoint3D line1P2,
OTSPoint3D line2P1,
OTSPoint3D line2P2)
Compute the 2D intersection of two line segments.
|
static OTSPoint3D |
intersectionOfLineSegmentsDumb(OTSPoint3D line1P1,
OTSPoint3D line1P2,
OTSPoint3D line2P1,
OTSPoint3D line2P2)
Deprecated.
|
OTSPoint3D |
normalize()
Return the point with a length of 1 to the origin.
|
String |
toString() |
OTSPoint3D |
translate(double factor)
Return this point translated by a factor from the origin.
|
public final double x
public final double y
public final double z
public OTSPoint3D(double x, double y, double z)
x
- x-coordinatey
- y-coordinatez
- z-coordinatepublic OTSPoint3D(double[] xyz)
xyz
- array with three elements; x, y and z are assumed to be in meters relative to an origin.public OTSPoint3D(OTSPoint3D point)
point
- a point to "clone".public OTSPoint3D(javax.vecmath.Point3d point)
point
- javax.vecmath 3D double point; the x, y and z in the point are assumed to be in meters relative to an
origin.public OTSPoint3D(CartesianPoint point)
point
- javax.vecmath 3D double point; the x, y and z in the point are assumed to be in meters relative to an
origin.public OTSPoint3D(DirectedPoint point)
point
- javax.vecmath 3D double point; the x, y and z in the point are assumed to be in meters relative to an
origin.public OTSPoint3D(Point2D point2d)
point2d
- java.awt 2D point, z-coordinate will be zero; the x and y in the point are assumed to be in meters
relative to an origin.public OTSPoint3D(com.vividsolutions.jts.geom.Coordinate coordinate)
coordinate
- geotools coordinate; the x, y and z in the coordinate are assumed to be in meters relative to an
origin.public OTSPoint3D(com.vividsolutions.jts.geom.Point point)
point
- geotools point; z-coordinate will be zero; the x and y in the point are assumed to be in meters relative to
an origin.public OTSPoint3D(double x, double y)
x
- x-coordinatey
- y-coordinatepublic static OTSPoint3D interpolate(double ratio, OTSPoint3D zeroValue, OTSPoint3D oneValue)
ratio
- double; 0 selects the zeroValue point, 1 selects the oneValue point, 0.5 selects a point halfway, etc.zeroValue
- OTSPoint3D; the point that is returned when ratio equals 0oneValue
- OTSPoint3D; the point that is returned when ratio equals 1@Deprecated public static OTSPoint3D intersectionOfLineSegmentsDumb(OTSPoint3D line1P1, OTSPoint3D line1P2, OTSPoint3D line2P1, OTSPoint3D line2P2)
line1P1
- OTSPoint3D; first point of line segment 1line1P2
- OTSPoint3D; second point of line segment 1line2P1
- OTSPoint3D; first point of line segment 2line2P2
- OTSPoint3D; second point of line segment 2public static OTSPoint3D intersectionOfLineSegments(OTSPoint3D line1P1, OTSPoint3D line1P2, OTSPoint3D line2P1, OTSPoint3D line2P2)
line1P1
- OTSPoint3D; first point of line segment 1line1P2
- OTSPoint3D; second point of line segment 1line2P1
- OTSPoint3D; first point of line segment 2line2P2
- OTSPoint3D; second point of line segment 2@Deprecated public static OTSPoint3D intersectionOfLinesDumb(OTSPoint3D line1P1, OTSPoint3D line1P2, OTSPoint3D line2P1, OTSPoint3D line2P2)
line1P1
- OTSPoint3D; first point of line 1line1P2
- OTSPoint3D; second point of line 1line2P1
- OTSPoint3D; first point of line 2line2P2
- OTSPoint3D; second point of line 2public static OTSPoint3D intersectionOfLines(OTSPoint3D line1P1, OTSPoint3D line1P2, OTSPoint3D line2P1, OTSPoint3D line2P2)
line1P1
- OTSPoint3D; first point of line 1line1P2
- OTSPoint3D; second point of line 1line2P1
- OTSPoint3D; first point of line 2line2P2
- OTSPoint3D; second point of line 2public final OTSPoint3D closestPointOnSegment(OTSPoint3D segmentPoint1, OTSPoint3D segmentPoint2)
segmentPoint1
- OTSPoint3D; start of line segmentsegmentPoint2
- OTSPoint3D; end of line segmentpublic final OTSPoint3D closestPointOnLine(OTSLine3D line)
line
- OTSLine3D; the linepublic final OTSPoint3D closestPointOnLine2D(OTSLine3D line)
line
- OTSLine3D; the linepublic final OTSPoint3D normalize()
public final OTSPoint3D translate(double factor)
factor
- the translation factorpublic static final List<OTSPoint3D> circleCenter(OTSPoint3D point1, OTSPoint3D point2, double radius)
point1
- OTSPoint3D; the first pointpoint2
- OTSPoint3D; the second pointradius
- double; the radiuspublic static final List<OTSPoint3D> circleIntersections(OTSPoint3D center1, double radius1, OTSPoint3D center2, double radius2)
center1
- OTSPoint3D; the center of circle 1radius1
- double; the radius of circle 1center2
- OTSPoint3D; the center of circle 2radius2
- double; the radius of circle 2public final double distanceSI(OTSPoint3D point)
point
- the point to which the distance has to be calculated.public final double horizontalDistanceSI(OTSPoint3D point)
point
- the point to which the distance has to be calculated.public final Length horizontalDistance(OTSPoint3D point)
point
- the point to which the distance has to be calculated.public final Length distance(OTSPoint3D point)
point
- the point to which the distance has to be calculated.public final com.vividsolutions.jts.geom.Coordinate getCoordinate()
public final DirectedPoint getDirectedPoint()
public final Point2D getPoint2D()
public final DirectedPoint getLocation()
getLocation
in interface Locatable
public final javax.media.j3d.Bounds getBounds()
Copyright © 2014–2018 Delft University of Technology. All rights reserved.