code: 
  
  
  
  
  
  
  """simple docstring"""
  
  
  
  
  
  
  import matplotlib.pyplot as plt
  import numpy as np
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A    ,       A			):
     UpperCamelCase_     =len(A			)  # Number of training samples
     UpperCamelCase_     =np.eye(A			)  # Initialize weights as identity matrix
     for j in range(A			):
        UpperCamelCase_     =point - x_train[j]
        UpperCamelCase_     =np.exp(diff @ diff.T / (-2.0 * tau**2)			)
  
     return weights
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A    ,       A    ,       A			):
     UpperCamelCase_     =weight_matrix(A    ,       A    ,       A			)
     UpperCamelCase_     =np.linalg.inv(x_train.T @ weight_mat @ x_train			) @ (
         x_train.T @ weight_mat @ y_train.T
     )
  
     return weight
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A    ,       A			):
     UpperCamelCase_     =np.zeros(len(A			)			)  # Initialize array of predictions
     for i, item in enumerate(A			):
        UpperCamelCase_     =item @ local_weight(A    ,       A    ,       A    ,       A			)
  
     return y_pred
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A    ,       A			):
     import seaborn as sns
  
     UpperCamelCase_     =sns.load_dataset(A			)
     UpperCamelCase_     =np.array(data[x_name]			)
     UpperCamelCase_     =np.array(data[y_name]			)
  
     UpperCamelCase_     =np.ones(len(A			)			)
  
     # pairing elements of one and x_data
     UpperCamelCase_     =np.column_stack((one, x_data)			)
  
     return x_train, x_data, y_data
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A    ,       A    ,       A    ,       A    ,       A    ,       ):
     UpperCamelCase_     =np.sort(A    ,       axis=0			)
     plt.scatter(A    ,       A    ,       color="blue"			)
     plt.plot(
         x_train_sorted[:, 1]    ,       preds[x_train[:, 1].argsort(0			)]    ,       color="yellow"    ,       linewidth=5    ,       )
     plt.title("Local Weighted Regression"			)
     plt.xlabel(A			)
     plt.ylabel(A			)
     plt.show()
  
  
  if __name__ == "__main__":
      import doctest
  
      doctest.testmod()
  
      # Demo with a dataset from the seaborn module
      A_  ,							A_  ,							A_			  =    load_data("tips", "total_bill", "tip")
      A_			  =    local_weight_regression(training_data_x, tip, 5)
      plot_preds(training_data_x, predictions, total_bill, tip, "total_bill", "tip")
  
style_context: 
  
  
  
  
  
  
  """simple docstring"""
  
  
  
  
  
  
  from math import radians as angle_to_radians
  from math import sin
  
  # Acceleration Constant on Earth (unit m/s^2)
  A_			  =    9.80665
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A			):
  
     # Ensure valid instance
     if not isinstance(A    ,       (int, float)			):
        raise TypeError("Invalid velocity. Should be a positive number."			)
  
     if not isinstance(A    ,       (int, float)			):
        raise TypeError("Invalid angle. Range is 1-90 degrees."			)
  
     # Ensure valid angle
     if angle > 90 or angle < 1:
        raise ValueError("Invalid angle. Range is 1-90 degrees."			)
  
     # Ensure valid velocity
     if init_velocity < 0:
        raise ValueError("Invalid velocity. Should be a positive number."			)
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A			):
     check_args(A    ,       A			)
     UpperCamelCase_     =angle_to_radians(2 * angle			)
     return round(init_velocity**2 * sin(A			) / g    ,       2			)
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A			):
     check_args(A    ,       A			)
     UpperCamelCase_     =angle_to_radians(A			)
     return round(init_velocity**2 * sin(A			) ** 2 / (2 * g)    ,       2			)
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A			):
     check_args(A    ,       A			)
     UpperCamelCase_     =angle_to_radians(A			)
     return round(2 * init_velocity * sin(A			) / g    ,       2			)
  
  
  
  
  def 						_UpperCamelCase			(  ):
     UpperCamelCase_    ,							UpperCamelCase_     =25, 20
     assert horizontal_distance(A    ,       A			) == 40.97
     assert max_height(A    ,       A			) == 3.73
     assert total_time(A    ,       A			) == 1.74
  
  
  if __name__ == "__main__":
      from doctest import testmod
  
      testmod()
  
      # Get input from user
      A_			  =    float(input("Initial Velocity: ").strip())
  
      # Get input from user
      A_			  =    float(input("angle: ").strip())
  
      # Print results
      print()
      print("Results: ")
      print(f'''Horizontal Distance: {horizontal_distance(init_vel, angle)!s} [m]''')
      print(f'''Maximum Height: {max_height(init_vel, angle)!s} [m]''')
      print(f'''Total Time: {total_time(init_vel, angle)!s} [s]''')
  