Created
December 31, 2017 03:13
-
-
Save tavinus/41d9a7b5f8dc38ace3f19df5c5c64992 to your computer and use it in GitHub Desktop.
Millimeters to Points
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
| int mm_to_points(double mm) { | |
| // 1 point = 1/72 inches | |
| // 1 inch = 25.4 mm | |
| // 1 mm = 1 / 25.4 inches | |
| // 1 inch = 72 points | |
| // x mm = x / 25.4 * 72 points | |
| return round(mm / 25.4 * 72); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment