Trivial calculation related to computer displays (core version)
Here's the core of the other version. I made something similar at first (except that it used zip ++). I have subsequently upgraded it to an ever neater form, but this does essentially the same. Read this one if you are short on time! ;-) #!/usr/bin/runhugs -- Calculates basic LCD monitor parameters from diagonals. -- -- Copyright (c) bkil, 2009 -- License: GNU GPL v2 (or later), see the -- attached gpl-2.0.txt for details. -- --Changelog: -- 2009.01.20 v0.0 first release -- 2009.01.22 v0.1 refactoring: cleanup, typo in comments -- 2009.01.29 v0.2 refactoring: friendlier names, Html type -- 2009.01.30 v0.2.1 messy version -- --the routine that calculates all the parameters -- input: diagonal, horizontal pixels, vertical pixels -- getparams :: Float -> Int -> Int -> String getparams diag_inch xi yi = show diag_inch ++ "in; " ++ show a ++ ":" ++ show b ++ "; " ++ show xi ++ "px; " ++ show yi ++ "px; " ++ show dotpitch ++