util
Class LinearInterpolation

java.lang.Object
  extended by util.LinearInterpolation

public class LinearInterpolation
extends java.lang.Object

An util class for linear interpolation of an ArrayList of Point

Author:
marco furlan

Field Summary
private  java.lang.Double m
          The angular coefficient
private  java.util.ArrayList<Point> points
          The list of Points
private  java.lang.Double q
          The y-axis intercept
 
Constructor Summary
LinearInterpolation(java.util.ArrayList<Point> points)
          The constructor.
 
Method Summary
 java.lang.Double getM()
           
 java.util.ArrayList<Point> getPoints()
           
 java.lang.Double getQ()
           
 void interpole()
          Interpoles the ArrayList of Point, using the interpolation formula minimizing the sum of the squared distances from points to rect line
 void setM(java.lang.Double m)
           
 void setPoints(java.util.ArrayList<Point> points)
           
 void setQ(java.lang.Double q)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

points

private java.util.ArrayList<Point> points
The list of Points


m

private java.lang.Double m
The angular coefficient


q

private java.lang.Double q
The y-axis intercept

Constructor Detail

LinearInterpolation

public LinearInterpolation(java.util.ArrayList<Point> points)
The constructor.

Parameters:
points - the ArrayList of Point to interpolate
Method Detail

interpole

public void interpole()
Interpoles the ArrayList of Point, using the interpolation formula minimizing the sum of the squared distances from points to rect line


getM

public java.lang.Double getM()
Returns:
the angular coefficient m

setM

public void setM(java.lang.Double m)
Parameters:
m - the the angular coefficient m to set

getQ

public java.lang.Double getQ()
Returns:
the y-intersection q

setQ

public void setQ(java.lang.Double q)
Parameters:
q - the y-intersection q to set

getPoints

public java.util.ArrayList<Point> getPoints()
Returns:
the points

setPoints

public void setPoints(java.util.ArrayList<Point> points)
Parameters:
points - the points to set