Below is one complete Python script that uses Matplotlib to “hard‐wire” all the coordinates so that the geometry is consistent with the given angles and dimensions. (In a real surveying problem the unknown distances would be solved for; here we use the relationship
P′y + tan(α₁)·D = R′y + tan(α₂)·(b + D)
to obtain the horizontal distance D between station P and the chimney’s base F.) In our example we let
- Station R be at (0,0) with R′ at (0, 1.64 m),
- Station P be at (127 m, 34.11 m) with P′ at (127, 35.98 m) (so that the vertical gap between the instrument horizontals is s = 35.98 – 1.64 = 34.34 m),
- The vane V is set at (127, 36.11 m) (giving h = 34.47 m from R′),
- We solve for D so that by using
- α₁ = 38°21′ ≃ 38.35° (red sight from P′ to Q),
- α₂ = 21°18′ ≃ 21.30° (blue sight from R′ to Q),
we have
35.98 + tan(α₁)·D = 1.64 + tan(α₂)·(127 + D).
A short calculation yields D ≈ 38.82 m so that the chimney’s vertical line is drawn at x = 127 + D = 165.82 m. Then the top of the chimney is defined by the red sight line so that
Qy = 35.98 + tan(38.35°)·(38.82) ≈ 66.66 m,
and we set the chimney base F at (165.82, 0).
You can run the following code as a self‐contained example. (Feel free to adjust colors, radii, and label positions as needed.)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import FancyArrowPatch, Arc
# Define given values and compute derived coordinates
# Station R (the lower station)
R = np.array([0, 0])
ht_R = 1.64 # Height of instrument at R
R_prime = np.array([R[0], R[1] + ht_R])
# Station P (the higher station)
b = 127 # horizontal distance between R and P
# We choose the ground level at P such that the vertical difference between
# the instrument horizontals is s = 34.34 m:
# (ht(P) + ground_P) - (ht(R) + ground_R) = 34.34
# With ht(P)=1.87 and ground_R=0, we get:
ground_P = 34.34 + R_prime[1] - 1.87 # = 34.34 + (1.64 - 1.87)
# Note: 1.64 - 1.87 = -0.23, so ground_P ≈ 34.11 m.
ground_P = 34.11
P = np.array([b, ground_P])
ht_P = 1.87 # height of instrument at P
P_prime = np.array([P[0], P[1] + ht_P])
# Vane at 2.0 m above ground at P:
V = np.array([P[0], P[1] + 2.0]) # V = (127, 36.11)
# Angles (in degrees)
alpha1 = 38 + 21/60 # angle at P' for red line (P'Q) ~38.35 deg.
alpha2 = 21 + 18/60 # angle at R' for blue line (R'Q) ~21.30 deg.
alpha = 15 + 11/60 # angle at R' for orange line (R'V) ~15.183 deg.
# Solve for D (horizontal distance from P to chimney base F)
# We require that: P'_y + tan(alpha1)*D = R'_y + tan(alpha2)*(b + D)
tan_a1 = np.tan(np.deg2rad(alpha1))
tan_a2 = np.tan(np.deg2rad(alpha2))
D = ( (R_prime[1] + tan_a2 * b) - P_prime[1] ) / (tan_a1 - tan_a2)
# Chimney: set its vertical line at x = P_x + D
chimney_x = P[0] + D
# Top of chimney (Q) using the red sight from P':
Q_y = P_prime[1] + tan_a1 * D
Q = np.array([chimney_x, Q_y])
# Base of chimney (F) on ground (we set it at y=0)
F = np.array([chimney_x, 0])
# Additional vertical differences for annotation
s = P_prime[1] - R_prime[1] # gap between horizontal instrument lines
h = V[1] - R_prime[1] # vertical difference from R' to V
# Create the figure
fig, ax = plt.subplots(figsize=(10, 7))
# 1. Scene layout and ground levels
# Draw the chimney as a tall vertical grey line (from F to Q+ extra height for visual clarity)
ax.plot([chimney_x, chimney_x], [F[1], Q[1]], color='grey', lw=6, solid_capstyle='butt', zorder=1)
ax.text(chimney_x + 1, Q[1], r'$Q$', color='grey', fontsize=12, va='bottom')
ax.text(chimney_x + 1, F[1], r'$F$', color='grey', fontsize=12, va='top')
# Ground levels:
# For station P: horizontal brown line at y = ground_P
ax.hlines(P[1], P[0]-10, P[0]+50, color='saddlebrown', lw=3)
# For station R: horizontal brown line at y = 0
ax.hlines(R[1], R[0]-10, R[0]+50, color='saddlebrown', lw=3)
# 2. Stations, instruments, and vane
# Station R: mark ground point and instrument
ax.plot(R[0], R[1], 'o', color='black')
ax.text(R[0]-4, R[1]-3, r'$R$', fontsize=12)
ax.plot(R_prime[0], R_prime[1], 'o', color='black')
ax.text(R_prime[0]-8, R_prime[1]+1, r"$R'\ (ht(R)=1.64\,m)$", fontsize=12)
# Draw vertical from R to R' (short vertical line)
ax.plot([R[0], R[0]], [R[1], R_prime[1]], color='black', lw=2)
# Horizontal dashed line emanating from R'
ax.hlines(R_prime[1], R_prime[0], chimney_x+20, colors='black', linestyles='dashed')
# Station P: mark ground point and instrument and vane
ax.plot(P[0], P[1], 'o', color='black')
ax.text(P[0]-4, P[1]-3, r'$P$', fontsize=12)
# Draw vertical purple line from P to V
ax.plot([P[0], P[0]], [P[1], V[1]], color='purple', lw=2)
# Mark instrument P' at 1.87 m above P
ax.plot(P_prime[0], P_prime[1], 'o', color='purple')
ax.text(P_prime[0]+2, P_prime[1]-3, r"$P'\ (ht(P)=1.87\,m)$", fontsize=12)
# Mark vane V (2.0 m above P)
ax.plot(V[0], V[1], 'o', color='purple')
ax.text(V[0]+2, V[1], r'$V\ (r=2.0\,m)$', fontsize=12)
# Horizontal dashed line emanating from P'
ax.hlines(P_prime[1], P_prime[0], chimney_x+20, colors='black', linestyles='dashed')
# 3. Lines of sight
# Red line: from P' to Q
ax.plot([P_prime[0], Q[0]], [P_prime[1], Q[1]], color='red', lw=2)
# Blue line: from R' to Q
ax.plot([R_prime[0], Q[0]], [R_prime[1], Q[1]], color='blue', lw=2)
# Orange line: from R' to V
ax.plot([R_prime[0], V[0]], [R_prime[1], V[1]], color='orange', lw=2)
# 4. Annotations, Dimensions, and Angles
# Horizontal distances:
# b: distance from R to P (draw below ground at y=-5)
arrow_props = dict(arrowstyle='<->', color='black', lw=1.5)
ax.annotate("", xy=(R[0], -5), xytext=(P[0], -5), arrowprops=arrow_props)
ax.text((R[0]+P[0])/2, -7, r'$b=127\,m$', fontsize=12, ha='center')
# D: distance from P to chimney's base F (draw below ground at y=-10)
ax.annotate("", xy=(P[0], -10), xytext=(F[0], -10), arrowprops=arrow_props)
ax.text((P[0]+F[0])/2, -12, r'$D\approx38.82\,m$', fontsize=12, ha='center')
# Vertical distances:
# s: between horizontal dashed lines (R' and P')
# Draw a double-headed arrow at x = chimney_x+5
ax.annotate("", xy=(chimney_x+5, R_prime[1]), xytext=(chimney_x+5, P_prime[1]), arrowprops=arrow_props)
ax.text(chimney_x+7, (R_prime[1]+P_prime[1])/2, r'$s=34.34\,m$', va='center', fontsize=12)
# h: vertical distance between horizontal from R' and point V
# Draw arrow at x = R[0]-10
ax.annotate("", xy=(R[0]-10, R_prime[1]), xytext=(R[0]-10, V[1]), arrowprops=arrow_props)
ax.text(R[0]-13, (R_prime[1]+V[1])/2, r'$h=34.47\,m$', va='center', fontsize=12, rotation=90)
# Angles:
# At P': show angle between red line (P'Q) and horizontal dashed line.
arc_radius_P = 10
arc_P = Arc(P_prime, arc_radius_P, arc_radius_P, angle=0, theta1=0, theta2=alpha1,
color='red', lw=1.5)
ax.add_patch(arc_P)
ax.text(P_prime[0] + arc_radius_P*0.7, P_prime[1] + arc_radius_P*0.2,
r'$\alpha_1=38^\circ21\'$', color='red', fontsize=12)
# At R': two angles.
# First, the smaller arc: angle between horizontal and R'V is α = 15°11'
arc_radius_R1 = 8
arc_R1 = Arc(R_prime, arc_radius_R1, arc_radius_R1, angle=0, theta1=0, theta2=alpha,
color='orange', lw=1.5)
ax.add_patch(arc_R1)
ax.text(R_prime[0] + arc_radius_R1*1.1, R_prime[1] + arc_radius_R1*0.1,
r'$\alpha=15^\circ11\'$', color='orange', fontsize=12)
# Second, the larger arc: angle between horizontal and R'Q is α₂ = 21°18'
arc_radius_R2 = 12
arc_R2 = Arc(R_prime, arc_radius_R2, arc_radius_R2, angle=0, theta1=0, theta2=alpha2,
color='blue', lw=1.5)
ax.add_patch(arc_R2)
# Place the label a bit further out.
ax.text(R_prime[0] + arc_radius_R2*1.0, R_prime[1] + arc_radius_R2*0.3,
r'$\alpha_2=21^\circ18\'$', color='blue', fontsize=12)
# 5. Final polish
ax.set_title("Surveying Problem Visualization", fontsize=16)
ax.axis('equal')
ax.axis('off')
plt.tight_layout()
plt.show()