use of org.eclipse.draw2d.geometry.PointList in project tdi-studio-se by Talend.
the class CreateComponentOnLinkHelper method getDistanceOrthogonal.
public static double getDistanceOrthogonal(double x, double y, PolylineConnection connection, double zoom) {
double distance = 1000000000;
double a = 0, b = 0, c = 0;
PointList points = connection.getPoints();
for (int i = 0; i < points.size() - 1; i++) {
Point point1 = points.getPoint(i);
Point point2 = points.getPoint(i + 1);
double dis = CreateComponentOnLinkHelper.getDistanceOrthogonal(x, y, point1, point2, zoom);
if (dis < distance) {
distance = dis;
}
}
return distance;
}
Aggregations