Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. import numpy as np
  2. import argparse
  3.  
  4. inch2cm=25.4
  5.  
  6. def calc_bezel_width(monitor_width,monitor_size_inch,width,height):
  7. monitor_size=monitor_size_inch*inch2cm
  8. display_zone_width=monitor_size*width/np.sqrt(width**2+height**2)
  9. bezel_width=(monitor_width-display_zone_width)/2
  10. return round(bezel_width,2)
  11.  
  12. if __name__=="__main__":
  13. parser=argparse.ArgumentParser(description="Calculate the bezel width of monitor")
  14. parser.add_argument('-mw',"--monitor_width",type=float,help="The width of the monitor product, generally in the spec of the monitor product")
  15. parser.add_argument('-ms',"--monitor_size", type=float,help="The size of the monitor, unit: inch")
  16. parser.add_argument('-w', "--width",type=float,help="The width of the monitor")
  17. parser.add_argument('-he', "--height",type=float,help="The height of the monitor")
  18. args=parser.parse_args()
  19. bezel_width=calc_bezel_width(args.monitor_width,args.monitor_size,args.width,args.height)
  20. print('The bezel width is', bezel_width,' cm')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement