Skip to content

Instantly share code, notes, and snippets.

@tavinus
Created December 31, 2017 03:13
Show Gist options
  • Select an option

  • Save tavinus/41d9a7b5f8dc38ace3f19df5c5c64992 to your computer and use it in GitHub Desktop.

Select an option

Save tavinus/41d9a7b5f8dc38ace3f19df5c5c64992 to your computer and use it in GitHub Desktop.
Millimeters to Points
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