Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import argparse
- inch2cm=25.4
- def calc_bezel_width(monitor_width,monitor_size_inch,width,height):
- monitor_size=monitor_size_inch*inch2cm
- display_zone_width=monitor_size*width/np.sqrt(width**2+height**2)
- bezel_width=(monitor_width-display_zone_width)/2
- return round(bezel_width,2)
- if __name__=="__main__":
- parser=argparse.ArgumentParser(description="Calculate the bezel width of monitor")
- parser.add_argument('-mw',"--monitor_width",type=float,help="The width of the monitor product, generally in the spec of the monitor product")
- parser.add_argument('-ms',"--monitor_size", type=float,help="The size of the monitor, unit: inch")
- parser.add_argument('-w', "--width",type=float,help="The width of the monitor")
- parser.add_argument('-he', "--height",type=float,help="The height of the monitor")
- args=parser.parse_args()
- bezel_width=calc_bezel_width(args.monitor_width,args.monitor_size,args.width,args.height)
- print('The bezel width is', bezel_width,' cm')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement