def test_angles(): print('Creating angle test') point1 = {'x': -4, 'y': 4} point2 = {'x': 0, 'y': 0} point3 = {'x': 2, 'y': 0} print('Getting angle') theta = ClassUtils.get_angle(point1, point2, point3) print('Angle: {0}'.format(theta)) degrees = theta * 180 / math.pi print('Angle degrees: {0}'.format(degrees)) print('Done!')
def main(): print('Initializing main function') print('Loading angle points') point_1 = [2, 2, 1] point_2 = [0, 0, 1] point_3 = [2, 0, 1] point_4 = [1, 0, 1] angle1 = ClassUtils.get_angle(point_1, point_2, point_3) * 180 / math.pi angle2 = ClassUtils.get_angle_lines(point_1, point_2, point_2, point_3) * 180 / math.pi angle3 = ClassUtils.get_angle_lines(point_1, point_2, point_3, point_4) * 180 / math.pi angle4 = ClassUtils.get_angle_lines(point_1, point_2, point_4, point_3) * 180 / math.pi print('Angle 1: {0} - Angle 2: {1} - Angle 3: {2} - Angle 4: {3}'.format( angle1, angle2, angle3, angle4)) print('Done!')