def test_points_folded_on_self_horizontally_joint_angle(self): joint = (Point((0, 0)), Point((0, 1)), Point((0, 0))) self.assertEqualRounded(Point.joint_angle(*joint), pi)
def test_first_two_points_same_joint_angle(self): joint = (Point((1, 1)), Point((1, 1)), Point((2, 1))) self.assertEqualRounded(Point.joint_angle(*joint), 0)
def test_all_points_same_joint_angle(self): joint = (Point((0, 0)), Point((0, 0)), Point((0, 0))) self.assertEqualRounded(Point.joint_angle(*joint), 0)
def test_colinear_joint_angle(self): joint = (Point((1, 1)), Point((2, 1)), Point((3, 1))) self.assertEqualRounded(Point.joint_angle(*joint), 0)
def test_right_down(self): joint = (Point((0, 0)), Point((1, 0)), Point((1, -1))) self.assertEqualRounded(Point.joint_angle(*joint), pi / 2)
def test_down_left(self): joint = (Point((0, 0)), Point((0, -1)), Point((-1, -1))) self.assertEqualRounded(Point.joint_angle(*joint), pi / 2)
def test_left_up(self): joint = (Point((0, 0)), Point((-1, 0)), Point((-1, 1))) self.assertEqualRounded(Point.joint_angle(*joint), pi / 2)
def test_up_right(self): joint = (Point((0, 0)), Point((0, 1)), Point((1, 1))) self.assertEqualRounded(Point.joint_angle(*joint), pi / 2)