org.ddogleg.example
Class DistanceFromLine
- java.lang.Object
-
- org.ddogleg.example.DistanceFromLine
-
- All Implemented Interfaces:
- DistanceFromModel<Line2D,Point2D>
public class DistanceFromLine extends java.lang.Object implements DistanceFromModel<Line2D,Point2D>
Computes the distance a point is from a line in 2D. Line is parameterized by the tangent point from the origin.
-
-
Constructor Summary
Constructors Constructor and Description DistanceFromLine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcomputeDistance(java.util.List<Point2D> obs, double[] distance)There are some situations where processing everything as a list can speed things up a lot.doublecomputeDistance(Point2D p)Computes the distance the point is from the model.voidsetModel(Line2D param)Sets the model parameters.
-
-
-
Method Detail
-
setModel
public void setModel(Line2D param)
Description copied from interface:DistanceFromModelSets the model parameters.- Specified by:
setModelin interfaceDistanceFromModel<Line2D,Point2D>- Parameters:
param- Model parameters.
-
computeDistance
public double computeDistance(Point2D p)
Description copied from interface:DistanceFromModelComputes the distance the point is from the model.- Specified by:
computeDistancein interfaceDistanceFromModel<Line2D,Point2D>- Parameters:
p- Point being evaluated. Not modified.- Returns:
- Distance the point is from the model.
-
computeDistance
public void computeDistance(java.util.List<Point2D> obs, double[] distance)
There are some situations where processing everything as a list can speed things up a lot. This is not one of them.- Specified by:
computeDistancein interfaceDistanceFromModel<Line2D,Point2D>- Parameters:
obs- Set of points which are to be evaluated.distance- Where model distance is stored.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG