public class Line extends Object
Modifier and Type | Field and Description |
---|---|
PlanePoint |
direction
The unit vector that, given the
origin point, identifies this
line. |
PlanePoint |
origin
The origin point of the line.
|
Constructor and Description |
---|
Line(PlanePoint o,
PlanePoint p)
Creates a new object to represent the line passing through the
o and p points. |
Line(PlanePoint p,
PlanePoint q,
PlanePoint o)
Creates a new object to represent the line passing through
o
and having direction pq. |
Modifier and Type | Method and Description |
---|---|
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(PlanePoint p)
Tells whether the specified point lies on this line.
|
boolean |
lies(PlanePoint p,
boolean positiveOrientation)
Tells whether the specified point lies on this line and within the
specified orientation.
|
public final PlanePoint origin
public final PlanePoint direction
origin
point, identifies this
line.public Line(PlanePoint o, PlanePoint p)
o
and p
points. The o
point
is taken to define the origin of the line and the direction is defined by
the op vector.o
- The origin of the line. Mustn't be null
.p
- A point of the line. Mustn't be null
nor the
same as o
.public Line(PlanePoint p, PlanePoint q, PlanePoint o)
o
and having direction pq. The p
and q
points are, respectively, the tail and head of the vector pq that
is taken to define the direction of the line.p
- Tail of a vector. Mustn't be null
.q
- Head of a vector. Mustn't be null
nor the same
as q
.o
- The origin of the line. Mustn't be null
.public PlanePoint getPoint(double k)
k
. More
precisely, this method returns the
origin
+kdirection
point.k
- The coefficient to select the point.public boolean lies(PlanePoint p)
p
- The point to test. Mustn't be null
.true
if p
lies on this line,
false
otherwise.public boolean lies(PlanePoint p, boolean positiveOrientation)
positiveOrientation
parameter
is used to specify which side (with respect to the origin
) of
the line to check. If true
, then we check to see whether
p
falls on the half line that has the same orientation as
the direction
unit vector this also includes the
origin
. If false
, we check to see whether
p
falls on the opposite half line.p
- The point to test. Mustn't be null
.positiveOrientation
- true
for the positive orientation,
false
for the strictly negative orientation.true
if p
lies on this line,
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.3.5-ice35-b73
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.