- java.lang.Object
-
- fr.inria.mochy.core.trajectory.Segment
-
public class Segment extends Object
segment has increasing abscissae and a decreasing ordinate it defines a part of a trajectory and contains two points
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
belong(Point p)
Segment
copy()
Float
cross(Segment segment)
return null if the current segment never cross the segment in parameter else : return the abscissa of the cross' point the equation is alpha*x+beta = alpha2*x+beta2 => x = (-beta+beta2)/(alpha-alpha2)void
drop()
float
getAlpha()
float
getBeta()
Point
getP0()
Point
getP1()
boolean
hasNext()
boolean
isHorizontal()
Float
ordinate(float x)
return the ordinate of a x abscissa value return null if x is not on the segmentvoid
setP0(Point p0)
void
setP1(Point p1)
void
shiftLeft(float x)
void
shiftRight(float x)
-
-
-
Method Detail
-
ordinate
public Float ordinate(float x)
return the ordinate of a x abscissa value return null if x is not on the segment
-
belong
public boolean belong(Point p)
-
cross
public Float cross(Segment segment)
return null if the current segment never cross the segment in parameter else : return the abscissa of the cross' point the equation is alpha*x+beta = alpha2*x+beta2 => x = (-beta+beta2)/(alpha-alpha2)
-
copy
public Segment copy()
-
shiftRight
public void shiftRight(float x)
-
shiftLeft
public void shiftLeft(float x)
-
isHorizontal
public boolean isHorizontal()
-
drop
public void drop()
-
getAlpha
public float getAlpha()
-
getBeta
public float getBeta()
-
hasNext
public boolean hasNext()
-
getP0
public Point getP0()
-
setP0
public void setP0(Point p0)
-
getP1
public Point getP1()
-
setP1
public void setP1(Point p1)
-
-