Sim
Class Line
java.lang.Object
Sim.Line
public class Line
- extends java.lang.Object
A line object to construct a line based on two points. This
object offers the slope, yintercept, available points on the
line and the intersection point given another line object.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Line
public Line(Location a,
Location b)
- Construct a line based on two location objects.
- Parameters:
a
- point 1 of this lineb
- points 2 of the line
getIntersection
public Location getIntersection(Line other)
- Get the intersection of this line and another.
- Parameters:
other
-
- Returns:
getKnownPoints
public java.util.ArrayList<Location> getKnownPoints()
isOnLine
public java.lang.Boolean isOnLine(Location l)
getSlope
public double getSlope()
getYintercept
public double getYintercept()