public class LineSegmentLane extends AbstractLane
| Constructor and Description |
|---|
LineSegmentLane(double x1,
double y1,
double x2,
double y2,
double width,
double speedLimit)
Constructs a line-segment lane using two sets of coordinates.
|
LineSegmentLane(Line2D line,
double width,
double speedLimit)
Constructs a line-segment lane using a Line.
|
LineSegmentLane(Point2D p1,
Point2D p2,
double width,
double speedLimit)
Constructs a line-segment lane using two points.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Point2D pos)
Whether or not the provided point can be considered "in" this Lane.
|
double |
distanceAlongLane(Point2D pos)
Get the distance along the Lane from the start of the Lane to the Point
in the center of the Lane nearest the given Point.
|
Point2D |
getEndPoint()
Get the ending point of the Lane.
|
double |
getHeadingAtNormalizedDistance(double normalizedDistance)
Get the heading of the Lane at a particular normalized distance from the
start of the Lane.
|
double |
getInitialHeading()
Get the heading of this Lane at its starting point.
|
Point2D |
getLeadPoint(Point2D pos,
double leadDist)
/**
Get a point further down the Lane from the nearest point to the given
position.
|
double |
getLength()
Get the length of this Lane.
|
Point2D |
getPointAtNormalizedDistance(double normalizedDistance)
Get a point in the center of the lane at a particular normalized distance
from the start of the Lane.
|
Shape |
getShape()
Get a Shape describing this Lane, including its width.
|
Shape |
getShape(double startFraction,
double endFraction)
Get a Shape describing an interval of this lane, using normalized
distances.
|
Point2D |
getStartPoint()
Get the starting point of the Lane.
|
double |
getTerminalHeading()
Get the heading of this Lane at its ending point.
|
double |
getWidth()
Get the width of this Lane, in meters.
|
Point2D |
intersectionPoint(Line2D l)
The point at which the the given Line intersects the center of this Lane.
|
Shape |
leftBorder()
Get a Shape representing the left border of this Lane.
|
Point2D |
leftIntersectionPoint(Line2D l)
The point at which the the given Line intersects the left border of this
Lane.
|
double |
nearestDistance(Point2D pos)
Get the distance from a point to the center of the Lane.
|
Point2D |
nearestPoint(Point2D p)
Get the point in the center of the Lane nearest to the provided point.
|
double |
normalizedDistance(double distance)
Get the normalized distance at the distance from the starting point.
|
double |
normalizedDistanceAlongLane(Point2D pos)
Get the normalized distance to the point in the center of the lane
nearest the provided point.
|
double |
remainingDistanceAlongLane(Point2D pos)
Get the amount of distance left in this Lane from the point on the Lane
nearest to the given point.
|
Shape |
rightBorder()
Get a Shape representing the right border of this Lane.
|
Point2D |
rightIntersectionPoint(Line2D l)
The point at which the the given Line intersects the right border of this
Lane.
|
getId, getLaneIM, getLeftNeighbor, getNextLane, getPrevLane, getRightNeighbor, getSpeedLimit, hasLeftNeighbor, hasNextLane, hasPrevLane, hasRightNeighbor, setId, setLeftNeighbor, setNextLane, setPrevLane, setRightNeighborpublic LineSegmentLane(Line2D line, double width, double speedLimit)
line - the line segment representing the center of the Lanewidth - the width of the Lane, in metersspeedLimit - the speed limit of the Lane, in meters per secondpublic LineSegmentLane(Point2D p1, Point2D p2, double width, double speedLimit)
p1 - the starting Point of the Lanep2 - the ending Point of the Lanewidth - the width of the Lane, in metersspeedLimit - the speed limit of the Lane, in meters per secondpublic LineSegmentLane(double x1,
double y1,
double x2,
double y2,
double width,
double speedLimit)
x1 - the x coordinate of the starting point of the Laney1 - the y coordinate of the starting point of the Lanex2 - the x coordinate of the ending point of the Laney2 - the y coordinate of the ending point of the Lanewidth - the width of the Lane, in metersspeedLimit - the speed limit of the Lane, in meters per secondpublic double getLength()
getLength in interface LanegetLength in class AbstractLanepublic Point2D getStartPoint()
getStartPoint in interface LanegetStartPoint in class AbstractLanepublic Point2D getEndPoint()
getEndPoint in interface LanegetEndPoint in class AbstractLanepublic Point2D getPointAtNormalizedDistance(double normalizedDistance)
getPointAtNormalizedDistance in interface LanegetPointAtNormalizedDistance in class AbstractLanenormalizedDistance - the normalized distance (between 0 and 1) from
the start of the Lanepublic Point2D nearestPoint(Point2D p)
nearestPoint in interface LanenearestPoint in class AbstractLanep - the point to which the nearest point in the center of the Lane
should be foundpublic double nearestDistance(Point2D pos)
nearestDistance in interface LanenearestDistance in class AbstractLanepos - the point from which to find the distance to the Lanepublic Point2D getLeadPoint(Point2D pos, double leadDist)
getLeadPoint in interface LanegetLeadPoint in class AbstractLanepos - the position from which to calculate the nearest point in
the LaneleadDist - the lead distance further down the Lane, in metersleadDist further down the Lane from
the closest point in the Lane to pospublic double distanceAlongLane(Point2D pos)
distanceAlongLane in interface LanedistanceAlongLane in class AbstractLanepos - the point to which to find the distance along the Lanepublic double remainingDistanceAlongLane(Point2D pos)
remainingDistanceAlongLane in interface LaneremainingDistanceAlongLane in class AbstractLanepos - the point nearest which to find the distance to the end of the
Lanepublic double normalizedDistanceAlongLane(Point2D pos)
normalizedDistanceAlongLane in interface LanenormalizedDistanceAlongLane in class AbstractLanepos - the point near to which to find the normalized distancepublic double normalizedDistance(double distance)
distance - the distance along the center of the lane.public double getInitialHeading()
getInitialHeading in interface LanegetInitialHeading in class AbstractLanepublic double getTerminalHeading()
getTerminalHeading in interface LanegetTerminalHeading in class AbstractLanepublic double getHeadingAtNormalizedDistance(double normalizedDistance)
getHeadingAtNormalizedDistance in interface LanegetHeadingAtNormalizedDistance in class AbstractLanenormalizedDistance - the normalized distance (between 0 and 1) from
the start of the Lanepublic Point2D intersectionPoint(Line2D l)
intersectionPoint in interface LaneintersectionPoint in class AbstractLanel - the Line with which to find the intersectionnull if it doesn't intersectpublic double getWidth()
getWidth in interface LanegetWidth in class AbstractLanepublic Shape getShape()
getShape in interface LanegetShape in class AbstractLanepublic Shape getShape(double startFraction, double endFraction)
getShape in interface LanegetShape in class AbstractLanestartFraction - the normalized distance from the start of the lane
to the start of the segment which the Shape
representsendFraction - the normalized distance from the start of the lane
to the end of the segment which the Shape representspublic boolean contains(Point2D pos)
contains in interface Lanecontains in class AbstractLanepos - the point to checkpublic Shape leftBorder()
leftBorder in interface LaneleftBorder in class AbstractLanepublic Shape rightBorder()
rightBorder in interface LanerightBorder in class AbstractLanepublic Point2D leftIntersectionPoint(Line2D l)
leftIntersectionPoint in interface LaneleftIntersectionPoint in class AbstractLanel - the Line with which to find the intersectionnull if it doesn't intersectpublic Point2D rightIntersectionPoint(Line2D l)
rightIntersectionPoint in interface LanerightIntersectionPoint in class AbstractLanel - the Line with which to find the intersectionnull if it doesn't intersectCopyright © 2013. All rights reserved.