|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunikl.disco.nc.LinearSegment
public class LinearSegment
Class representing linear segments of a curve. A linear segments starts at
point (x0
, y0
) and continues to the right
with slope grad
. If leftopen
is
true
, the point (x0
,y0
) is
excluded from the segment, otherwise is is included.
Field Summary | |
---|---|
double |
grad
The gradient of the linear segment |
boolean |
leftopen
Whether the point ( x0 , y0 ) is part of the segment or not. |
static LinearSegment |
X_AXIS
|
double |
x0
The x-coordinate of the linear segment's starting point. |
double |
y0
The y-coordinate of the linear segment's starting point. |
Constructor Summary | |
---|---|
LinearSegment()
The default constructor. |
|
LinearSegment(double x0,
double y0,
double grad,
boolean leftopen)
A convenience constructor. |
Method Summary | |
---|---|
LinearSegment |
copy()
Returns a copy of this instance. |
double |
f(double x)
Returns the function value of this linear segment at the given x-coordinate. |
double |
getXIntersectionWith(LinearSegment other)
Returns the x-coordinate at which a co-linear line through this segment intersects a co-linear line through the segment other . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final LinearSegment X_AXIS
public double x0
public double y0
public double grad
public boolean leftopen
x0
, y0
) is part of the segment or not.
Constructor Detail |
---|
public LinearSegment()
public LinearSegment(double x0, double y0, double grad, boolean leftopen)
x0
- y0
- grad
- leftopen
- Method Detail |
---|
public LinearSegment copy()
public double f(double x)
x
- the coorinate whose function value shall be returned
public double getXIntersectionWith(LinearSegment other)
other
.
other
- the other segment
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |