# HW 25 Solution # Problem 1 # Note that even though the test values are integers, # the inputs should be floats because these values # could be floats in more general examples import math as m a = float(input('Input a ')) c = float(input('Input c ')) b = m.sqrt(c**2 - a**2) beta = m.degrees(m.asin(a/c)) alpha = m.degrees(m.asin(b/c)) # Could also do # beta = m.asin(a/c)*m.pi/180 # alpha = m.asin(b/c)*m.pi/180 print('b = ',b) print('beta = ',beta) print('alpha = ',alpha) # Problem 2 # The inputs should also be floats here because they # could be floats for more general examples x1 = float(input('Input x1 ')) y1 = float(input('Input y1 ')) x2 = float(input('Input x2 ')) y2 = float(input('Input y2 ')) slope = (y2-y1)/(x2-x1) yint = slope*x1 - y1 print('sl =',slope) print('y intercept',yint) """ Input a 1 Input c 4 b = 3.872983346207417 beta = 14.477512185929925 alpha = 75.52248781407009 --------------------------- Input x1 -4 Input y1 2 Input x2 6 Input y2 3 sl = 0.1 y intercept -2.4 """