#!/usr/bin/python
import sys
from math import sqrt
lenses = (
("Arsat 30mm f/3.5", 30.0),
("Mir-26 45mm f/3.5", 45.0),
("MC PCS Arsat 55mm f/4.5", 55.0),
("Mir-38 65mm f/3.5", 65.0),
("Arsat 80mm f/2.8", 80.0),
("Vega 120mm f/2.8", 120.0),
("Kaleinar-3 150mm f/2.8", 150.0),
("Telear-5 250mm f/5.6
Jupiter-36 250mm f/3.5", 250.0),
("Tayir-33 300mm f/4.5-22", 300.0),
("MC APO Arsat 500mm f/5.6", 500.0),
)
r_120_width_ratio = (56.0 / 36.0)
r_6x6_height_ratio = (56.0 / 24.0)
r_645_height_ratio = (42.0 / 24.0)
diagonal_35mm = sqrt(36.0**2.0 + 24.0**2.0)
diagonal_6x6 = sqrt(56.0**2.0 + 56.0**2.0)
diagonal_645 = sqrt(56.0**2.0 + 42.0**2.0)
hurr = (
("6x6 (W)", r_120_width_ratio),
("6x6 (H)", r_6x6_height_ratio),
("6x6 (avg)", (r_120_width_ratio + r_6x6_height_ratio) / 2.0),
("6x6 (diag)", diagonal_6x6 / diagonal_35mm),
("", 0),
("6x4.5 (W)", r_120_width_ratio),
("6x4.5 (H)", r_645_height_ratio),
("6x4.5 (avg)", (r_120_width_ratio + r_645_height_ratio) / 2.0),
("6x4.5 (diag)", diagonal_645 / diagonal_35mm),
)
print "
" for x in hurr: if x[0] == "": print ' | ' else: print " | %s | " % x[0] sys.stderr.write("%s: %s\n" % (x[0], round(x[1], 2))) print "
---|---|---|
%s | " % (lens[0]) for x in hurr: if x[0] == "": print "" else: print " | %smm | " % (int(round(lens[1] / x[1], 2))) print "