use of com.disnodeteam.dogecv.math.Line in project Relic_Main by TeamOverdrive.
the class Lines method getMeanPoint.
public static Point getMeanPoint(List<Line> lines) {
if (lines.size() == 0)
return null;
double x = 0;
double y = 0;
for (Line line : lines) {
x += line.center().x;
y += line.center().y;
}
return new Point(x / lines.size(), y / lines.size());
}
use of com.disnodeteam.dogecv.math.Line in project Relic_Main by TeamOverdrive.
the class Lines method getPerpindicularDistance.
public static double getPerpindicularDistance(Line line1, Point point) {
Line perp = Lines.getPerpindicular(line1, Lines.crossSign(line1, point));
Line joint = new Line(line1.center(), point);
return Math.cos(Lines.getAngularDistance(perp, joint) * Math.PI / 180) * joint.length();
}