Asymptote Diagram Prompts
For Asymptote physics diagrams, the most reliable workflow is to use AI to generate editable Asymptote code that you can refine, reuse, and export as publication-quality vector graphics (PDF/SVG/PNG). Asymptote is especially valuable when diagrams require 3D geometry, controlled perspective, surfaces, coordinate systems, spatial trajectories, or technical linework beyond typical 2D textbook schematics.
Use GPT-5.5 Thinking (or an equivalent model strong in LaTeX, Asymptote, 3D geometry, vector calculus, and code correction).
Request editable Asymptote code, not an image.
When to Prefer Asymptote Over TikZ
- 3D
- perspective-based
- surface-based
- coordinate-system-heavy
- spatially geometric
- involving rotations
- involving trajectories in space
- requiring technical vector graphics
- mainly 2D
- force-based
- label-heavy
- simple textbook schematic
- ordinary free-body diagram
Master Prompt Template
Act as an expert physics illustrator and Asymptote technical diagram designer.
I am preparing a publication-quality applied physics textbook. Generate a clean, editable Asymptote diagram for the following physics problem.
Problem:
[Write the full physics problem here]
Diagram requirements:
- Use Asymptote only.
- Output complete compilable Asymptote code.
- Use a clean academic textbook style.
- Use mathematically correct geometry.
- Use proper 2D or 3D perspective according to the problem.
- Use clear LaTeX-style labels.
- Mark important vectors, axes, angles, radii, surfaces, trajectories, and reference lines.
- Use arrows where vectors or directions are required.
- Use dashed construction lines where useful.
- Avoid decorative or artistic elements.
- Keep labels readable and non-overlapping.
- Use simple black-and-white style unless color is necessary.
- Do not use external images.
- Make the code easy to edit.
- Output only the Asymptote code.
Style preference:
- White background
- Clean technical drawing
- Thin but visible lines
- Large readable labels
- Minimal shading
- Publication-quality vector output
Worked Prompt Examples
Generate a clean 3D Asymptote diagram for spherical polar coordinates.
Problem:
A point P in space is represented by spherical polar coordinates r, theta, and phi. Draw the coordinate system and show the geometrical meaning of r, theta, and phi.
Diagram requirements:
- Draw 3D x, y, and z axes.
- Place point P in the first octant.
- Draw position vector r from the origin O to P.
- Draw the projection of P on the xy-plane.
- Draw a dashed line from P to its projection on the xy-plane.
- Mark polar angle theta between the positive z-axis and r.
- Mark azimuthal angle phi in the xy-plane from the positive x-axis to the projection of r.
- Label O, P, r, theta, phi, x, y, and z.
- Use a clean academic textbook style.
- Use black-and-white or very minimal color.
- Output complete compilable Asymptote code.
- Output only the code.
Generate a clean 3D Asymptote diagram for rigid body rotation.
Problem:
A rigid body rotates about a fixed axis. Show the angular velocity vector omega, angular momentum vector L, and torque vector tau.
Diagram requirements:
- Draw a simple 3D rigid body as an ellipsoid or irregular solid.
- Draw a fixed rotation axis passing through the body.
- Draw angular velocity vector omega along the rotation axis.
- Draw angular momentum vector L.
- Draw torque vector tau in a different direction.
- Label all vectors clearly.
- Show a curved arrow around the rotation axis to indicate rotation.
- Use clean perspective.
- Keep the diagram suitable for a classical mechanics textbook.
- Avoid unnecessary artistic detail.
- Output complete compilable Asymptote code.
- Output only the code.
Generate a clean Asymptote diagram for Rutherford scattering.
Problem:
An alpha particle approaches a heavy nucleus with impact parameter b and is scattered through an angle theta. Show the incoming trajectory, outgoing trajectory, impact parameter, and scattering angle.
Diagram requirements:
- Place the heavy nucleus at the origin.
- Draw the incoming alpha particle trajectory from the left.
- Draw the outgoing scattered trajectory.
- Show the impact parameter b as the perpendicular distance from the initial straight-line path to the nucleus.
- Mark the scattering angle theta between the initial and final asymptotic directions.
- Label alpha particle, nucleus, b, and theta.
- Use arrowheads to show direction of motion.
- Use dashed construction lines for asymptotic directions.
- Use clean black-and-white textbook style.
- Output complete compilable Asymptote code.
- Output only the code.
Generate a clean 3D Asymptote diagram for electromagnetism.
Problem:
A circular current loop carries current I. Show the magnetic field geometry around the loop and the axis of symmetry.
Diagram requirements:
- Draw a circular current loop in 3D perspective.
- Indicate current direction using small arrows on the loop.
- Draw the symmetry axis passing through the centre of the loop.
- Draw magnetic field lines passing through the loop and curving around it.
- Label current I and magnetic field B.
- Label the axis of the loop.
- Use clean linework and minimal shading.
- Keep the figure suitable for an electromagnetism textbook.
- Avoid excessive field lines.
- Output complete compilable Asymptote code.
- Output only the code.
Generate a clean Asymptote diagram for a particle collision.
Problem:
Two incoming particles collide at an interaction point and produce three outgoing particles. Show the incoming and outgoing trajectories with scattering angles.
Diagram requirements:
- Draw two incoming particle tracks approaching an interaction point.
- Draw three outgoing particle tracks leaving the interaction point.
- Label the interaction point as O.
- Label incoming particles p_1 and p_2.
- Label outgoing particles q_1, q_2, and q_3.
- Mark at least one scattering angle theta.
- Use arrows to show direction of motion.
- Keep the figure clean and schematic.
- Use a black-and-white academic style.
- Make it suitable for a nuclear or particle physics textbook.
- Output complete compilable Asymptote code.
- Output only the code.
Generate a clean Asymptote diagram for wavefront and ray geometry.
Problem:
A plane wavefront is incident on a boundary surface. Show the incident ray, reflected ray, refracted ray, normal, and angles of incidence, reflection, and refraction.
Diagram requirements:
- Draw the boundary plane separating two media.
- Label medium 1 and medium 2.
- Draw the normal at the point of incidence.
- Draw incident ray, reflected ray, and refracted ray.
- Mark angle of incidence i, angle of reflection r, and angle of refraction t.
- Add a few parallel wavefront lines perpendicular to the incident ray.
- Use arrows to show ray directions.
- Keep labels readable.
- Use a clean academic textbook style.
- Output complete compilable Asymptote code.
- Output only the code.
Generate a clean 3D Asymptote diagram of a potential energy surface.
Problem:
A particle moves on a two-dimensional potential surface V(x,y). Draw a simple potential well surface and show a possible trajectory of the particle.
Diagram requirements:
- Draw 3D coordinate axes x, y, and V.
- Draw a smooth potential well surface.
- Show a particle trajectory curve on the surface.
- Label the surface as V(x,y).
- Label the coordinate axes.
- Use minimal shading only if necessary.
- Keep the diagram mathematically clean.
- Make it suitable for a theoretical mechanics or quantum mechanics textbook.
- Output complete compilable Asymptote code.
- Output only the code.
Revision Prompts for Iterative Improvement
Problems to fix:
1. [Mention issue 1]
2. [Mention issue 2]
3. [Mention issue 3]
Correction requirements:
1. Preserve the same physical meaning.
2. Keep the code fully compilable.
3. Improve perspective and spatial clarity.
4. Improve label placement.
5. Avoid overlapping labels.
6. Make vectors and arrows physically meaningful.
7. Simplify the drawing if it looks crowded.
8. Keep the academic textbook style.
9. Output the complete corrected Asymptote code.
10. Output only the code.
Generate a high-quality 3D physics diagram with correct perspective and clean vector geometry.
Requirements:
1. Choose a camera angle that clearly shows all important objects.
2. Use dashed lines for hidden or construction lines.
3. Use solid lines for physical objects.
4. Use arrows for vectors and directions.
5. Avoid excessive shading.
6. Keep labels readable from the chosen view.
7. Use simple geometry rather than artistic complexity.
8. Make the code modular and easy to edit.
9. Output complete compilable Asymptote code only.
Requirements:
1. Define consistent styles for:
- coordinate axes
- vectors
- dashed construction lines
- trajectories
- angle arcs
- surfaces
- particles
- labels
2. Use a clean black-and-white academic style.
3. Make the style suitable for mechanics, electromagnetism, nuclear physics, and particle physics diagrams.
4. Include one example 3D diagram using the style system.
5. Keep the code easy to reuse in future diagrams.
6. Output complete compilable Asymptote code.
7. Output only the code.