Created
July 12, 2016 11:16
-
-
Save chinghanho/7c74bf7b63da1674e542bb332cbc6f5e to your computer and use it in GitHub Desktop.
計算鏡頭焦距及標準全級光圈光闌面積
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
focals = [20, 50, 85] | |
f_numbers = [1.4, 2, 2.8, 4, 5.6] | |
focals.each do |focal| | |
puts "鏡頭焦距:#{focal}mm" | |
puts "" | |
f_numbers.each do |f| | |
a = ((((focal/f)/2)**2)*3.14).round(2) | |
printf "ƒ/%-5s 光闌面積 %-6s mm2\n", f, a | |
end | |
puts "" | |
puts "" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment