|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.util.math.geom2D.Line
public class Line
An orientated line in the Euclidean space R2.
Field Summary | |
---|---|
PlanePoint |
direction
The unit vector that, given the origin point, identifies this
line. |
PlanePoint |
origin
The origin point of the line. |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final PlanePoint origin
direction
unit vector is said to have positive orientation this also
includes the origin
point. All other points of the line are said
to have (strictly) negative orientation.
public final PlanePoint direction
origin
point, identifies this
line.
Constructor Detail |
---|
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
.Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: 4.3.4-dbcbce5a-b4
Copyright © 2009 The University of Dundee. All Rights Reserved.