at.tuwien.ifs.somtoolbox.clustering.functions
Class ComponentLine3DDistance
java.lang.Object
at.tuwien.ifs.somtoolbox.clustering.functions.ComponentLine3DDistance
- All Implemented Interfaces:
- ClusterElementFunctions<ComponentLine3D>
public class ComponentLine3DDistance
- extends Object
- implements ClusterElementFunctions<ComponentLine3D>
Method Summary |
static double |
areaLineDistance(Point3d[] line1,
Point3d[] line2)
Computes the distance between two lines by computing the area stretching between them. |
double |
distance(ComponentLine3D element1,
ComponentLine3D element2)
|
double |
distance(Point3d[] points1,
Point3d[] points2)
|
static double |
editLineDistance(Point3d[] line1,
Point3d[] line2)
Computes the distance between two lines in terms of edit operations necessary to move one line onto the other. |
static double |
euclideanLineDistance(Point3d[] line1,
Point3d[] line2)
Computes the distance between two lines in terms of absolute distances between single segments. |
static double |
euclideanLineDistanceDifferentNumberOfStops(Point3d[] line1,
Point3d[] line2)
|
static ClusterElementFunctions<ComponentLine3D> |
getEuclidean()
|
int |
getIndexOfLineClosestToMean(Cluster<? extends ComponentLine3D> elements)
|
private static Point3d |
getNextValidPoint(Point3d[] line,
int index)
|
private static Point3d |
getPreviousValidPoint(Point3d[] line,
int index)
|
static boolean |
linesParallel(Point3d line1Begin,
Point3d line1End,
Point3d line2Begin,
Point3d line2End)
Computes if two lines are parallel to each other, by checking the cross product of their direction vectors. |
ComponentLine3D |
meanObject(Cluster<? extends ComponentLine3D> elements)
|
static double |
minimumEuclideanLineDistance(Point3d[] line1,
Point3d[] line2)
Computes the distance between two lines in terms of distances between single segments. |
String |
toString(Cluster<? extends ComponentLine3D> elements)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
distanceType
private DistanceFunctionType distanceType
ComponentLine3DDistance
public ComponentLine3DDistance(DistanceFunctionType distanceType)
getEuclidean
public static ClusterElementFunctions<ComponentLine3D> getEuclidean()
distance
public double distance(ComponentLine3D element1,
ComponentLine3D element2)
- Specified by:
distance
in interface ClusterElementFunctions<ComponentLine3D>
distance
public double distance(Point3d[] points1,
Point3d[] points2)
euclideanLineDistance
public static double euclideanLineDistance(Point3d[] line1,
Point3d[] line2)
- Computes the distance between two lines in terms of absolute distances between single segments.
getNextValidPoint
private static Point3d getNextValidPoint(Point3d[] line,
int index)
getPreviousValidPoint
private static Point3d getPreviousValidPoint(Point3d[] line,
int index)
euclideanLineDistanceDifferentNumberOfStops
public static double euclideanLineDistanceDifferentNumberOfStops(Point3d[] line1,
Point3d[] line2)
minimumEuclideanLineDistance
public static double minimumEuclideanLineDistance(Point3d[] line1,
Point3d[] line2)
- Computes the distance between two lines in terms of distances between single segments.
editLineDistance
public static double editLineDistance(Point3d[] line1,
Point3d[] line2)
- Computes the distance between two lines in terms of edit operations necessary to move one line onto the other.
This basically computes distances for beginning and end points of single lines and penalises non parallel lines .
linesParallel
public static boolean linesParallel(Point3d line1Begin,
Point3d line1End,
Point3d line2Begin,
Point3d line2End)
- Computes if two lines are parallel to each other, by checking the cross product of their direction vectors.
areaLineDistance
public static double areaLineDistance(Point3d[] line1,
Point3d[] line2)
- Computes the distance between two lines by computing the area stretching between them.
meanObject
public ComponentLine3D meanObject(Cluster<? extends ComponentLine3D> elements)
- Specified by:
meanObject
in interface ClusterElementFunctions<ComponentLine3D>
getIndexOfLineClosestToMean
public int getIndexOfLineClosestToMean(Cluster<? extends ComponentLine3D> elements)
toString
public String toString(Cluster<? extends ComponentLine3D> elements)
- Specified by:
toString
in interface ClusterElementFunctions<ComponentLine3D>