Sim
Class Line

java.lang.Object
  extended by 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.


Constructor Summary
Line(Location a, Location b)
          Construct a line based on two location objects.
 
Method Summary
 Location getIntersection(Line other)
          Get the intersection of this line and another.
 java.util.ArrayList<Location> getKnownPoints()
           
 double getSlope()
           
 double getYintercept()
           
 java.lang.Boolean isOnLine(Location l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Line

public Line(Location a,
            Location b)
Construct a line based on two location objects.

Parameters:
a - point 1 of this line
b - points 2 of the line
Method Detail

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()