draftply Download

Map Scale & Proportions

← All samples

map-scale-proportion.dplyEditor
1---
2version: 0.1.0
3precision: 2
4---
5# draftply — Map Scale & Proportions
6# "3 cm on the map is 1.5 km in reality — how far is 7.3 cm?"
7# proportion(a, b, c) solves a : b = ? : c → result = a·c / b
8
9# ── Map scale ────────────────────────────────────
10map_cm = 3 # cm measured on the map
11real_km = 1.5 # km that distance represents
12segment = 7.3 # cm to convert
13
14real_distance_km = proportion(segment, map_cm, real_km)
15"Real distance for 7.3 cm (km)": real_distance_km
16
17# A map scale of 1:25000 means 1 cm on the map is 25000 cm in reality.
18scale = 25000
19cm_on_map = 4.6
20
21real_distance_m = proportion(cm_on_map, 1, scale) / 100
22"1:25000 map, 4.6 cm → real distance (m)": real_distance_m
23
24# ── Floor plan ───────────────────────────────────
25plan_cm = 2.4 # cm on the plan
26plan_real_m = 3.0 # m that length represents (from the scale bar)
27wall_cm = 8.1 # cm you measured for a wall
28
29wall_m = proportion(wall_cm, plan_cm, plan_real_m)
30"Wall length (m)": wall_m
31
32# ── Recipe ratio ─────────────────────────────────
33# A dough recipe calls for 500 g flour per 300 ml water. How much water
34# for 850 g flour?
35flour_ref = 500
36water_ref = 300
37flour_have = 850
38
39water_needed = proportion(flour_have, flour_ref, water_ref)
40"Water needed for 850 g flour (ml)": water_needed
41
42# ── Paint mixing ─────────────────────────────────
43# A test batch mixed 40 ml blue with 160 ml white. Scaling up to 900 ml
44# white, how much blue keeps the same shade?
45blue_ref = 40
46white_ref = 160
47white_have = 900
48
49blue_needed = proportion(white_have, white_ref, blue_ref)
50"Blue needed for 900 ml white (ml)": blue_needed
51