Skip to content
FlowScript templates

Figure — optics ray path

Ray-path through a converging lens. Typed FlowScript for 2-D figure composition. Keywords: figure, schematic, diagram, annotation.

Template previewFlowScript
Converging lens — image formationObjectRay 1Ray 2ImageFF'

Make it your own.

// Ray-path through a converging lens. Demonstrates labelled
// arrows, dashed reference lines, and annotation callouts.

figure optics {
  title: "Converging lens — image formation"
  width: 820
  height: 420
}

// Optical axis (dashed horizontal reference).
arrow_2d {
  x1: 40
  y1: 210
  x2: 780
  y2: 210
  color: "#94a3b8"
  dashed: true
  head: none
}

// Lens — tall thin ellipse on the axis.
shape lens {
  kind: ellipse
  x: 410
  y: 210
  w: 30
  h: 220
  fill: "#bae6fd"
  stroke: "#0369a1"
  strokeWidth: 1.6
}

// Object (upright arrow on the left).
shape obj_base {
  kind: line
  x: 180
  y: 210
  w: 0
  h: -90
  stroke: "#dc2626"
  strokeWidth: 2.4
}
shape obj_tip {
  kind: triangle
  x: 170
  y: 110
  w: 20
  h: 14
  fill: "#dc2626"
  stroke: "#dc2626"
}
label_2d {
  text: "Object"
  x: 180
  y: 100
  anchor: middle
  size: 11
  color: "#7f1d1d"
}

// Three rays: parallel → focus, through-centre, focus → parallel.
arrow_2d {
  x1: 180
  y1: 120
  x2: 410
  y2: 120
  color: "#16a34a"
  head: none
}
arrow_2d {
  x1: 410
  y1: 120
  x2: 700
  y2: 300
  color: "#16a34a"
  label: "Ray 1"
}
arrow_2d {
  x1: 180
  y1: 120
  x2: 700
  y2: 300
  color: "#2563eb"
  label: "Ray 2"
}

// Image (inverted arrow on the right, smaller).
shape img_base {
  kind: line
  x: 700
  y: 210
  w: 0
  h: 90
  stroke: "#dc2626"
  strokeWidth: 2.4
  dashed: true
}
shape img_tip {
  kind: triangle
  x: 690
  y: 286
  w: 20
  h: 14
  fill: "none"
  stroke: "#dc2626"
}
label_2d {
  text: "Image"
  x: 700
  y: 318
  size: 11
  color: "#7f1d1d"
}

// Focal points.
shape f_left {
  kind: circle
  x: 330
  y: 210
  r: 4
  fill: "#0369a1"
}
shape f_right {
  kind: circle
  x: 490
  y: 210
  r: 4
  fill: "#0369a1"
}
label_2d { text: "F"  x: 330  y: 230  size: 11  color: "#0369a1" }
label_2d { text: "F'" x: 490  y: 230  size: 11  color: "#0369a1" }

view ray_path: figure(optics)