public class Segment extends Object
Modifier and Type | Field and Description |
---|---|
double |
directionX1
The end point of the segment's first element.
|
double |
directionX2
The end point of the segment's second element.
|
double |
originX1
The origin of the segment's first element.
|
double |
originX2
The origin of the segment's first element.
|
Constructor and Description |
---|
Segment(double originX1,
double originX2,
double endX1,
double endX2)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(double k,
double x1,
double x2)
Performs an equality test based on a point on this line defined
by
k as in getPoint() and another given point. |
boolean |
equals(Object o)
Overridden to reflect equality of abstract values (data object) as
opposite to object identity.
|
PlanePoint |
getPoint(double k)
Returns the point of this line defined by
k . |
int |
hashCode()
Overridden to reflect equality of abstract values (data object) as
opposite to object identity.
|
boolean |
lies(double x1,
double x2)
Tells whether a specified point lies on this line.
|
public final double originX1
public final double originX2
public final double directionX1
public final double directionX2
public Segment(double originX1, double originX2, double endX1, double endX2)
originX1
- The origin of the segment's first element.originX2
- The origin of the segment's first element.o
- The origin point of the segment.endX1
- The end point's first element.endX2
- The end point's second element.public PlanePoint getPoint(double k)
k
. More
precisely, this method returns the
#origin
+k#direction
point.k
- The coefficient to select the point. Must be in the range
[0, 1]
.public boolean lies(double x1, double x2)
p
- The point to test. Mustn't be null
.true
if p
lies on this line,
false
otherwise.public boolean equals(double k, double x1, double x2)
k
as in getPoint()
and another given point.k
- The coefficient to select the point. Must be in the range
[0, 1]
.x1
- The point to test's first element.x2
- The point to test's second element.true
if the points are geometrically equal,
false
otherwise.public boolean equals(Object o)
equals
in class Object
Object.equals(Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
Version: 5.1.3-ice35-b52
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.