Dec => Bin => Hex


In [1]:
def dec_conv(decimal=5, number=10):
  print("   i |    Decimal |                           Binary | Hexadecimal")
  print("-----+------------+----------------------------------+-------------")
  for i in range(number):
    print("{0:4} | {1:10d} | {1:032b} | {1:11X}".format(i,decimal+i))  


dec_conv(decimal=2000,number=10)


   i |    Decimal |                           Binary | Hexadecimal
-----+------------+----------------------------------+-------------
   0 |       2000 | 00000000000000000000011111010000 |         7D0
   1 |       2001 | 00000000000000000000011111010001 |         7D1
   2 |       2002 | 00000000000000000000011111010010 |         7D2
   3 |       2003 | 00000000000000000000011111010011 |         7D3
   4 |       2004 | 00000000000000000000011111010100 |         7D4
   5 |       2005 | 00000000000000000000011111010101 |         7D5
   6 |       2006 | 00000000000000000000011111010110 |         7D6
   7 |       2007 | 00000000000000000000011111010111 |         7D7
   8 |       2008 | 00000000000000000000011111011000 |         7D8
   9 |       2009 | 00000000000000000000011111011001 |         7D9

Bin => Hex => Dec


In [2]:
def bin_conv(binary='10011010', number=10):
  dec = int(binary, 2)
  print("   i |    Decimal |                           Binary | Hexadecimal")
  print("-----+------------+----------------------------------+-------------")
  for i in range(number):
    print("{0:4} | {1:10d} | {1:032b} | {1:11x}".format(i,dec+i))

bin_conv(binary='10011010', number=10) # binary without 0b


   i |    Decimal |                           Binary | Hexadecimal
-----+------------+----------------------------------+-------------
   0 |        154 | 00000000000000000000000010011010 |          9a
   1 |        155 | 00000000000000000000000010011011 |          9b
   2 |        156 | 00000000000000000000000010011100 |          9c
   3 |        157 | 00000000000000000000000010011101 |          9d
   4 |        158 | 00000000000000000000000010011110 |          9e
   5 |        159 | 00000000000000000000000010011111 |          9f
   6 |        160 | 00000000000000000000000010100000 |          a0
   7 |        161 | 00000000000000000000000010100001 |          a1
   8 |        162 | 00000000000000000000000010100010 |          a2
   9 |        163 | 00000000000000000000000010100011 |          a3

Hex => Bin => Dec


In [3]:
def conv_hex(hexa='a', number=10):
  dec = int(hexa, 16)
  print("   i |    Decimal |                           Binary | Hexadezimal")
  print("-----+------------+----------------------------------+-------------")
  for i in range(number):
    print("{0:4} | {1:10d} | {1:032b} | {1:11x}".format(i,dec+i))
  
conv_hex(hexa='a', number=10) # hexa without 0x


   i |    Decimal |                           Binary | Hexadezimal
-----+------------+----------------------------------+-------------
   0 |         10 | 00000000000000000000000000001010 |           a
   1 |         11 | 00000000000000000000000000001011 |           b
   2 |         12 | 00000000000000000000000000001100 |           c
   3 |         13 | 00000000000000000000000000001101 |           d
   4 |         14 | 00000000000000000000000000001110 |           e
   5 |         15 | 00000000000000000000000000001111 |           f
   6 |         16 | 00000000000000000000000000010000 |          10
   7 |         17 | 00000000000000000000000000010001 |          11
   8 |         18 | 00000000000000000000000000010010 |          12
   9 |         19 | 00000000000000000000000000010011 |          13

Pixel => Subpixel => $\mu m$

$mm$ => Pixel


In [2]:
import numpy as np
# Pixel convert to um
def px_conv(pixel=10, subpixel_resolution=32):
  resolutions    = [150, 360, 600, 720, 1200, 2400, 4800] # dpi
  inch2cm        = 2.54 # cm/inch
  
  pixel_pitch = np.empty(shape=[len(resolutions)], dtype=np.float64) # um
  for i in range(len(resolutions)):
    pixel_pitch[i] = (inch2cm/resolutions[i])*10000 # in um
  
  subpixel = pixel*subpixel_resolution
  um = np.empty(shape=[len(resolutions)], dtype=np.float64) # um
  for i in range(len(resolutions)):
    um[i] = (pixel*pixel_pitch[i])
  
  print("   Pixel | Subpixel |  um @ {}dpi |   um @ {}dpi |    um @ {}dpi |    um @ {}dpi |   um @ {}dpi".format(resolutions[0], resolutions[1], resolutions[2], resolutions[3], resolutions[4]))
  print("---------+----------+--------------+---------------+----------------+----------------+----------------")
  print("{0:6}px | {1:8} | {2:10.3f}um |  {3:>10.3f}um |   {4:>10.3f}um |   {5:>10.3f}um |   {6:>10.3f}um".format(pixel, subpixel, um[0], um[1], um[2], um[3], um[4]))
  print("")

  
# mm convert to Pixel  
def mm_conv(mm=10, subpixel_resolution=32):
  resolutions    = [150, 360, 600, 720, 1200, 2400, 4800] # dpi
  inch2cm        = 2.54 # cm/inch
  
  pixel_pitch = np.empty(shape=[len(resolutions)], dtype=np.float64) # um
  for i in range(len(resolutions)):
    pixel_pitch[i] = (inch2cm/resolutions[i])*10 # in mm
  
  pixel = np.empty(shape=[len(resolutions)], dtype=np.float64)
  subpixel = np.empty(shape=[len(resolutions)], dtype=np.float64)
  for i in range(len(resolutions)):
    pixel[i]    = mm/pixel_pitch[i]
    subpixel[i] = pixel[i]*subpixel_resolution
  
  print("      mm |  Px @ {}dpi |   Px @ {}dpi |    Px @ {}dpi |    Px @ {}dpi |   Px @ {}dpi".format(resolutions[0], resolutions[1], resolutions[2], resolutions[3], resolutions[4]))
  print("---------+--------------+---------------+----------------+----------------+----------------")
  print("{0:6}mm | {1:10.3f}px |  {2:>10.3f}px |   {3:>10.3f}px |   {4:>10.3f}px |   {5:>10.3f}px".format(mm, pixel[0], pixel[1], pixel[2], pixel[3], pixel[4]))
  print("")

In [6]:
px_conv(pixel=256)
mm_conv(mm=3.1)
px_conv(pixel=3007)
px_conv(pixel=279)
px_conv(pixel=292)

px_conv(pixel=3009)
px_conv(pixel=4961)
px_conv(pixel=16441)

px_conv(pixel=12)
px_conv(pixel=279)
px_conv(pixel=50)
px_conv(pixel=100)
px_conv(pixel=1024)
#px_conv(pixel=1000)
#px_conv(pixel=10000)
#px_conv(pixel=1642)
#px_conv(pixel=682)

mm_conv(mm=1)
mm_conv(mm=2.5)
mm_conv(mm=10)
mm_conv(mm=100)
#mm_conv(mm=1000)
mm_conv(mm=2000)

mm_conv(mm=50)
mm_conv(mm=90)

## Xaar Printhead
#mm_conv(mm=(1.41+0.0235*2))
#mm_conv(mm=(4.74))

## Print Env Dropwatcher
#mm_conv(mm=279.4)
#mm_conv(mm=0.847)
#px_conv(pixel=384)

## Xaar Printhead definitions
#mm_conv(mm=4.798)
#mm_conv(mm=5.298)

px_conv(pixel=13)
px_conv(pixel=279)
px_conv(pixel=292)
px_conv(pixel=1280)
px_conv(pixel=5000)
px_conv(pixel=2000)
px_conv(pixel=10000)


px_conv(pixel=4252)
px_conv(pixel=3118)

px_conv(pixel=3971)
px_conv(pixel=2014)

px_conv(pixel=16536)
px_conv(pixel=24460)


mm_conv(mm=18)
mm_conv(mm=4)
mm_conv(mm=11.9)
mm_conv(mm=0.931+0.931+0.931+0.931+1.016)

px_conv(pixel=3118)


   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
   256px |     8192 |  43349.333um |   18062.222um |    10837.333um |     9031.111um |     5418.667um

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
   3.1mm |     18.307px |      43.937px |       73.228px |       87.874px |      146.457px

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  3007px |    96224 | 509185.333um |  212160.556um |   127296.333um |   106080.278um |    63648.167um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
   279px |     8928 |  47244.000um |   19685.000um |    11811.000um |     9842.500um |     5905.500um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
   292px |     9344 |  49445.333um |   20602.222um |    12361.333um |    10301.111um |     6180.667um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  3009px |    96288 | 509524.000um |  212301.667um |   127381.000um |   106150.833um |    63690.500um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  4961px |   158752 | 840062.667um |  350026.111um |   210015.667um |   175013.056um |   105007.833um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
 16441px |   526112 | 2784009.333um |  1160003.889um |   696002.333um |   580001.944um |   348001.167um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
    12px |      384 |   2032.000um |     846.667um |      508.000um |      423.333um |      254.000um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
   279px |     8928 |  47244.000um |   19685.000um |    11811.000um |     9842.500um |     5905.500um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
    50px |     1600 |   8466.667um |    3527.778um |     2116.667um |     1763.889um |     1058.333um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
   100px |     3200 |  16933.333um |    7055.556um |     4233.333um |     3527.778um |     2116.667um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  1024px |    32768 | 173397.333um |   72248.889um |    43349.333um |    36124.444um |    21674.667um

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
     1mm |      5.906px |      14.173px |       23.622px |       28.346px |       47.244px

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
   2.5mm |     14.764px |      35.433px |       59.055px |       70.866px |      118.110px

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
    10mm |     59.055px |     141.732px |      236.220px |      283.465px |      472.441px

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
   100mm |    590.551px |    1417.323px |     2362.205px |     2834.646px |     4724.409px

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
  2000mm |  11811.024px |   28346.457px |    47244.094px |    56692.913px |    94488.189px

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
    50mm |    295.276px |     708.661px |     1181.102px |     1417.323px |     2362.205px

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
    90mm |    531.496px |    1275.591px |     2125.984px |     2551.181px |     4251.969px

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
    13px |      416 |   2201.333um |     917.222um |      550.333um |      458.611um |      275.167um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
   279px |     8928 |  47244.000um |   19685.000um |    11811.000um |     9842.500um |     5905.500um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
   292px |     9344 |  49445.333um |   20602.222um |    12361.333um |    10301.111um |     6180.667um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  1280px |    40960 | 216746.667um |   90311.111um |    54186.667um |    45155.556um |    27093.333um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  5000px |   160000 | 846666.667um |  352777.778um |   211666.667um |   176388.889um |   105833.333um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  2000px |    64000 | 338666.667um |  141111.111um |    84666.667um |    70555.556um |    42333.333um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
 10000px |   320000 | 1693333.333um |  705555.556um |   423333.333um |   352777.778um |   211666.667um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  4252px |   136064 | 720005.333um |  300002.222um |   180001.333um |   150001.111um |    90000.667um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  3118px |    99776 | 527981.333um |  219992.222um |   131995.333um |   109996.111um |    65997.667um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  3971px |   127072 | 672422.667um |  280176.111um |   168105.667um |   140088.056um |    84052.833um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  2014px |    64448 | 341037.333um |  142098.889um |    85259.333um |    71049.444um |    42629.667um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
 16536px |   529152 | 2800096.000um |  1166706.667um |   700024.000um |   583353.333um |   350012.000um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
 24460px |   782720 | 4141893.333um |  1725788.889um |   1035473.333um |   862894.444um |   517736.667um

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
    18mm |    106.299px |     255.118px |      425.197px |      510.236px |      850.394px

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
     4mm |     23.622px |      56.693px |       94.488px |      113.386px |      188.976px

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
  11.9mm |     70.276px |     168.661px |      281.102px |      337.323px |      562.205px

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
  4.74mm |     27.992px |      67.181px |      111.969px |      134.362px |      223.937px

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  3118px |    99776 | 527981.333um |  219992.222um |   131995.333um |   109996.111um |    65997.667um


In [16]:
px_conv(pixel=1024*2-32)
px_conv(pixel=1024*3-2*32)

mm_conv(mm=1)


   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  2016px |    64512 | 341376.000um |  142240.000um |    85344.000um |    71120.000um |    42672.000um

   Pixel | Subpixel |  um @ 150dpi |   um @ 360dpi |    um @ 600dpi |    um @ 720dpi |   um @ 1200dpi
---------+----------+--------------+---------------+----------------+----------------+----------------
  3008px |    96256 | 509354.667um |  212231.111um |   127338.667um |   106115.556um |    63669.333um

      mm |  Px @ 150dpi |   Px @ 360dpi |    Px @ 600dpi |    Px @ 720dpi |   Px @ 1200dpi
---------+--------------+---------------+----------------+----------------+----------------
     1mm |      5.906px |      14.173px |       23.622px |       28.346px |       47.244px

Speed

$\frac{mm}{s}$ to $\frac{m}{s}$ to $\frac{m}{min}$ to $\frac{km}{h}$ to $mph$ to $\frac{ft}{s}$


In [6]:
def speed_conversion(speed_mm_sec = None, speed_m_sec = None, speed_m_min = None, speed_km_h = None):
  if not(speed_mm_sec == None):
    speed_mm_sec = float(speed_mm_sec)
    speed_m_sec  = float(speed_mm_sec)/1000.0
    speed_m_min  = float(speed_mm_sec)/1000.0*60.0
    speed_km_h   = float(speed_m_min)/1000.0*60.0
    speed_mph    = float(speed_km_h)*0.6214
    speed_ft_sec = float(speed_mph)*1.467
  elif not(speed_m_sec == None):
    speed_mm_sec = float(speed_m_sec)*1000.0
    speed_m_sec  = float(speed_m_sec)
    speed_m_min  = float(speed_mm_sec)/1000.0*60.0
    speed_km_h   = float(speed_m_min)/1000.0*60.0
    speed_mph    = float(speed_km_h)*0.6214
    speed_ft_sec = float(speed_mph)*1.467
  elif not(speed_m_min == None):
    speed_mm_sec = float(speed_m_min)/60.0*1000.0
    speed_m_sec  = float(speed_m_min)/60.0
    speed_m_min  = float(speed_m_min)
    speed_km_h   = float(speed_m_min)/1000.0*60.0
    speed_mph    = float(speed_km_h)*0.6214
    speed_ft_sec = float(speed_mph)*1.467
  elif not(speed_km_h == None):
    speed_m_min  = float(speed_km_h)*1000/60.0
    speed_mm_sec = float(speed_m_min)/60.0*1000.0
    speed_m_sec  = float(speed_m_min)/60.0
    speed_km_h   = float(speed_km_h)
    speed_mph    = float(speed_km_h)*0.6214
    speed_ft_sec = float(speed_mph)*1.467
  print("| {:>8.5} mm/s | {:>8.5} m/s | {:>8.5} m/min | {:>8.5} km/h | {:>8.5} mph | {:>9.5} ft/s |".format(speed_mm_sec, speed_m_sec, speed_m_min, speed_km_h, speed_mph, speed_ft_sec))

print("|                                Speed Conversions                                              |")
print("|---------------+--------------+----------------+---------------+--------------+----------------+")  
speed_conversion(speed_mm_sec=1)    # mm/sec
speed_conversion(speed_m_sec=0.001) # m/sec
speed_conversion(speed_m_min=0.06)  # m/min
speed_conversion(speed_km_h=0.0036) # km/h
speed_conversion(speed_m_sec=0.5)   # m/s

speed_conversion(speed_m_min=2)  # m/min
speed_conversion(speed_m_min=150)  # m/min
speed_conversion(speed_m_min=60)  # m/min
speed_conversion(speed_m_min=30)  # m/min
speed_conversion(speed_m_min=15)  # m/min
speed_conversion(speed_m_min=10)  # m/min
print("|---------------+--------------+----------------+---------------+--------------+----------------+")


|                                Speed Conversions                                              |
|---------------+--------------+----------------+---------------+--------------+----------------+
|      1.0 mm/s |    0.001 m/s |     0.06 m/min |   0.0036 km/h | 0.002237 mph | 0.0032817 ft/s |
|      1.0 mm/s |    0.001 m/s |     0.06 m/min |   0.0036 km/h | 0.002237 mph | 0.0032817 ft/s |
|      1.0 mm/s |    0.001 m/s |     0.06 m/min |   0.0036 km/h | 0.002237 mph | 0.0032817 ft/s |
|      1.0 mm/s |    0.001 m/s |     0.06 m/min |   0.0036 km/h | 0.002237 mph | 0.0032817 ft/s |
|    500.0 mm/s |      0.5 m/s |     30.0 m/min |      1.8 km/h |   1.1185 mph |    1.6409 ft/s |
|   33.333 mm/s | 0.033333 m/s |      2.0 m/min |     0.12 km/h | 0.074568 mph |   0.10939 ft/s |
|   2500.0 mm/s |      2.5 m/s |    150.0 m/min |      9.0 km/h |   5.5926 mph |    8.2043 ft/s |
|   1000.0 mm/s |      1.0 m/s |     60.0 m/min |      3.6 km/h |    2.237 mph |    3.2817 ft/s |
|    500.0 mm/s |      0.5 m/s |     30.0 m/min |      1.8 km/h |   1.1185 mph |    1.6409 ft/s |
|    250.0 mm/s |     0.25 m/s |     15.0 m/min |      0.9 km/h |  0.55926 mph |   0.82043 ft/s |
|   166.67 mm/s |  0.16667 m/s |     10.0 m/min |      0.6 km/h |  0.37284 mph |   0.54696 ft/s |
|---------------+--------------+----------------+---------------+--------------+----------------+

Fire Frequency / Time


In [13]:
speed   = 0.5  # m/s
dpi     = 600  # dpi

inch2mm = 25.4 # mm/inch
speed_mm_s = speed*1000 # mm/s
pixel_pitch = (inch2mm/dpi) # mm

fire_freq = speed_mm_s/pixel_pitch # Hz
fire_period = 1/fire_freq

print("Calculating Fire Frequency / Time")
print("----------------------------------")
print("Speed = {} m/s".format(speed))
print("DPI   = {}".format(dpi))
print("----------------------------------")
print("Pixel Pitch    = {:>5.3} mm  =  {:>5.4} um".format(pixel_pitch, pixel_pitch*1000))
print("Fire Period    = {:>5.2} s  = {:>5.3} ms = {} us".format(fire_period, fire_period*1000, fire_period*1000*1000))
print("Fire Frequency = {:>5.2} Hz = {:>5.4} kHz = {} MHz".format(fire_freq, fire_freq/1000, fire_freq/(1000*1000)))


Calculating Fire Frequency / Time
----------------------------------
Speed = 0.5 m/s
DPI   = 600
----------------------------------
Pixel Pitch    = 0.0423 mm  =  42.33 um
Fire Period    = 8.5e-05 s  = 0.0847 ms = 84.6666666667 us
Fire Frequency = 1.2e+04 Hz = 11.81 kHz = 0.011811023622 MHz