#!/usr/bin/python3 # ================================================================== # display the angle between the Y axes and another vector # (used to test/understand the meaning of the angle) # =================================================================== import numpy as np import user_interface as ui from two_vector_angle import two_vector_angle v1 = [0.0,10.0] # Y axis while(True): # ---- get and verify the users input print() s = ui.get_user_input('Enter test angle (degrees): ') if not s: break tf,f = ui.is_float(s) if not tf: print() print(f'input error ({s})') continue # ---- convert the test angle to a test vector r = np.deg2rad(f) v2 = [10.0 * np.cos(r), 10.0 * np.sin(r)] # ---- calculate the angle between the # ---- Y axes and a test vector a_rad = two_vector_angle(v1,v2,True) # ---- display the results a_deg = np.rad2deg(a_rad) print() print(f'a_deg = {a_deg}') print()