4 from TestSketcher import SketcherTestCase
6 class SketcherSetPerpendicular(SketcherTestCase):
7 """Test case for prependicular constraint testing."""
9 l1 = self.sketch.addLine(0, 0, 0, 1)
10 l2 = self.sketch.addLine(0, 0, 1, 1)
11 self.sketch.setPerpendicular(l1, l2)
14 dot_product = (l1.endPoint().x() - l1.startPoint().x()) * \
15 (l2.endPoint().x() - l2.startPoint().x()) + \
16 (l1.endPoint().y() - l1.startPoint().y()) * \
17 (l2.endPoint().y() - l2.startPoint().y())
18 self.assertAlmostEqual(dot_product, 0.0, delta=TestSketcher.DELTA)
20 if __name__ == "__main__":