@maniclang/workbench 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (644) hide show
  1. package/CONTRIBUTING.md +40 -0
  2. package/README.md +155 -0
  3. package/dist/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  4. package/dist/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  5. package/dist/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  6. package/dist/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  7. package/dist/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  8. package/dist/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  9. package/dist/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  10. package/dist/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  11. package/dist/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  12. package/dist/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  13. package/dist/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  14. package/dist/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  15. package/dist/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  16. package/dist/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  17. package/dist/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  18. package/dist/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  19. package/dist/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  20. package/dist/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  21. package/dist/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  22. package/dist/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  23. package/dist/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  24. package/dist/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  25. package/dist/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  26. package/dist/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  27. package/dist/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  28. package/dist/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  29. package/dist/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  30. package/dist/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  31. package/dist/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  32. package/dist/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  33. package/dist/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  34. package/dist/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  35. package/dist/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  36. package/dist/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  37. package/dist/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  38. package/dist/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  39. package/dist/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  40. package/dist/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  41. package/dist/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  42. package/dist/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  43. package/dist/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  44. package/dist/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  45. package/dist/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  46. package/dist/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  47. package/dist/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  48. package/dist/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  49. package/dist/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  50. package/dist/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  51. package/dist/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  52. package/dist/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  53. package/dist/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  54. package/dist/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  55. package/dist/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  56. package/dist/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  57. package/dist/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  58. package/dist/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  59. package/dist/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  60. package/dist/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  61. package/dist/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  62. package/dist/client/assets/abap-CRCWOmpq.js +1 -0
  63. package/dist/client/assets/apex-DnsZk_dE.js +1 -0
  64. package/dist/client/assets/azcli-1IWB1ccx.js +1 -0
  65. package/dist/client/assets/bat-DPkNLes8.js +1 -0
  66. package/dist/client/assets/bicep-Corcdgou.js +2 -0
  67. package/dist/client/assets/cameligo-CGrWLZr3.js +1 -0
  68. package/dist/client/assets/clojure-D9WOWImG.js +1 -0
  69. package/dist/client/assets/codicon-CgENjH2v.ttf +0 -0
  70. package/dist/client/assets/coffee-B7EJu28W.js +1 -0
  71. package/dist/client/assets/cpp-SEyurbux.js +1 -0
  72. package/dist/client/assets/csharp-BoL64M5l.js +1 -0
  73. package/dist/client/assets/csp-C46ZqvIl.js +1 -0
  74. package/dist/client/assets/css-DQU6DXDx.js +3 -0
  75. package/dist/client/assets/cssMode-CtRONlr8.js +4 -0
  76. package/dist/client/assets/cypher-D84EuPTj.js +1 -0
  77. package/dist/client/assets/dart-D8lhlL1r.js +1 -0
  78. package/dist/client/assets/dockerfile-DLk6rpji.js +1 -0
  79. package/dist/client/assets/ecl-BO6FnfXk.js +1 -0
  80. package/dist/client/assets/editor.worker-CZyr7Ur9.js +26 -0
  81. package/dist/client/assets/elixir-BRjLKONM.js +1 -0
  82. package/dist/client/assets/flow9-Cac8vKd7.js +1 -0
  83. package/dist/client/assets/freemarker2-BTSNJUl8.js +3 -0
  84. package/dist/client/assets/fsharp-fd1GTHhf.js +1 -0
  85. package/dist/client/assets/go-O9LJTZXk.js +1 -0
  86. package/dist/client/assets/graphql-LQdxqEYJ.js +1 -0
  87. package/dist/client/assets/handlebars-qkUBjVg6.js +1 -0
  88. package/dist/client/assets/hcl-DxDQ3s82.js +1 -0
  89. package/dist/client/assets/html-pguqE00h.js +1 -0
  90. package/dist/client/assets/htmlMode-BCCLuk2F.js +4 -0
  91. package/dist/client/assets/index-BFrMLHHu.css +1 -0
  92. package/dist/client/assets/index-CdBC-xgi.js +1250 -0
  93. package/dist/client/assets/ini-BvajGCUy.js +1 -0
  94. package/dist/client/assets/java-SYsfObOQ.js +1 -0
  95. package/dist/client/assets/javascript-ciDUXdez.js +1 -0
  96. package/dist/client/assets/jsonMode-BmkXC0tI.js +10 -0
  97. package/dist/client/assets/julia-DQXNmw_w.js +1 -0
  98. package/dist/client/assets/kotlin-qQ0MG-9I.js +1 -0
  99. package/dist/client/assets/less-GGFNNJHn.js +2 -0
  100. package/dist/client/assets/lexon-Canl7DCW.js +1 -0
  101. package/dist/client/assets/liquid-CwE4UIwf.js +1 -0
  102. package/dist/client/assets/lua-D28Ae8-K.js +1 -0
  103. package/dist/client/assets/m3-DPitgjJI.js +1 -0
  104. package/dist/client/assets/markdown-B811l8j2.js +1 -0
  105. package/dist/client/assets/mdx-K_9Emnjy.js +1 -0
  106. package/dist/client/assets/mips-CdjsipkG.js +1 -0
  107. package/dist/client/assets/msdax-CYqgjx_P.js +1 -0
  108. package/dist/client/assets/mysql-BHd6q0vd.js +1 -0
  109. package/dist/client/assets/objective-c-B1aVtJYH.js +1 -0
  110. package/dist/client/assets/pascal-BhNW15KB.js +1 -0
  111. package/dist/client/assets/pascaligo-5jv8CcQD.js +1 -0
  112. package/dist/client/assets/perl-DlYyT36c.js +1 -0
  113. package/dist/client/assets/pgsql-Dy0bjov7.js +1 -0
  114. package/dist/client/assets/php-120yhfDK.js +1 -0
  115. package/dist/client/assets/pla-CjnFlu4u.js +1 -0
  116. package/dist/client/assets/postiats-CQpG440k.js +1 -0
  117. package/dist/client/assets/powerquery-DdJtto1Z.js +1 -0
  118. package/dist/client/assets/powershell-Bu_VLpJB.js +1 -0
  119. package/dist/client/assets/protobuf-IBS6jZEB.js +2 -0
  120. package/dist/client/assets/pug-kFxLfcjb.js +1 -0
  121. package/dist/client/assets/python-BzIc0EVe.js +1 -0
  122. package/dist/client/assets/qsharp-q7JyzKFN.js +1 -0
  123. package/dist/client/assets/r-BIFz-_sK.js +1 -0
  124. package/dist/client/assets/razor-lXZl6dtu.js +1 -0
  125. package/dist/client/assets/redis-CHOsPHWR.js +1 -0
  126. package/dist/client/assets/redshift-CBifECDb.js +1 -0
  127. package/dist/client/assets/restructuredtext-CghPJEOS.js +1 -0
  128. package/dist/client/assets/ruby-CYWGW-b1.js +1 -0
  129. package/dist/client/assets/rust-DMDD0SHb.js +1 -0
  130. package/dist/client/assets/sb-BYAiYHFx.js +1 -0
  131. package/dist/client/assets/scala-Bqvq8jcR.js +1 -0
  132. package/dist/client/assets/scheme-Dhb-2j9p.js +1 -0
  133. package/dist/client/assets/scss-CTwUZ5N7.js +3 -0
  134. package/dist/client/assets/shell-CsDZo4DB.js +1 -0
  135. package/dist/client/assets/solidity-CME5AdoB.js +1 -0
  136. package/dist/client/assets/sophia-RYC1BQQz.js +1 -0
  137. package/dist/client/assets/sparql-KEyrF7De.js +1 -0
  138. package/dist/client/assets/sql-BdTr02Mf.js +1 -0
  139. package/dist/client/assets/st-C7iG7M4S.js +1 -0
  140. package/dist/client/assets/swift-D7IUmUK8.js +1 -0
  141. package/dist/client/assets/systemverilog-DgMryOEJ.js +1 -0
  142. package/dist/client/assets/tcl-PloMZuKG.js +1 -0
  143. package/dist/client/assets/tsMode-BAXmgo_t.js +11 -0
  144. package/dist/client/assets/twig-BfRIq3la.js +1 -0
  145. package/dist/client/assets/typescript-Cdf8nS1n.js +1 -0
  146. package/dist/client/assets/typespec-CzxlYoT_.js +1 -0
  147. package/dist/client/assets/vb-BwAE3J76.js +1 -0
  148. package/dist/client/assets/wgsl-B_1kOXbF.js +298 -0
  149. package/dist/client/assets/xml-DGyPgYnj.js +1 -0
  150. package/dist/client/assets/yaml-Dqv3HtbL.js +1 -0
  151. package/dist/client/index.html +14 -0
  152. package/dist/client/manic-logo.png +0 -0
  153. package/dist/client/wasm/manic_lang.d.ts +74 -0
  154. package/dist/client/wasm/manic_lang.js +302 -0
  155. package/dist/client/wasm/manic_lang_bg.wasm +0 -0
  156. package/dist/client/wasm/manic_lang_bg.wasm.d.ts +13 -0
  157. package/dist/server/agentProtocol.d.ts +131 -0
  158. package/dist/server/agentProtocol.js +21 -0
  159. package/dist/server/agentProtocol.js.map +1 -0
  160. package/dist/server/agentRuns.d.ts +46 -0
  161. package/dist/server/agentRuns.js +138 -0
  162. package/dist/server/agentRuns.js.map +1 -0
  163. package/dist/server/agentThreads.d.ts +20 -0
  164. package/dist/server/agentThreads.js +205 -0
  165. package/dist/server/agentThreads.js.map +1 -0
  166. package/dist/server/aiSecrets.d.ts +21 -0
  167. package/dist/server/aiSecrets.js +68 -0
  168. package/dist/server/aiSecrets.js.map +1 -0
  169. package/dist/server/app.d.ts +34 -0
  170. package/dist/server/app.js +804 -0
  171. package/dist/server/app.js.map +1 -0
  172. package/dist/server/assets.d.ts +34 -0
  173. package/dist/server/assets.js +659 -0
  174. package/dist/server/assets.js.map +1 -0
  175. package/dist/server/candidateFix.d.ts +28 -0
  176. package/dist/server/candidateFix.js +111 -0
  177. package/dist/server/candidateFix.js.map +1 -0
  178. package/dist/server/cli.d.ts +2 -0
  179. package/dist/server/cli.js +118 -0
  180. package/dist/server/cli.js.map +1 -0
  181. package/dist/server/diagnostics.d.ts +13 -0
  182. package/dist/server/diagnostics.js +73 -0
  183. package/dist/server/diagnostics.js.map +1 -0
  184. package/dist/server/engineCheck.d.ts +7 -0
  185. package/dist/server/engineCheck.js +60 -0
  186. package/dist/server/engineCheck.js.map +1 -0
  187. package/dist/server/engineInstall.d.ts +34 -0
  188. package/dist/server/engineInstall.js +228 -0
  189. package/dist/server/engineInstall.js.map +1 -0
  190. package/dist/server/enginePaths.d.ts +3 -0
  191. package/dist/server/enginePaths.js +76 -0
  192. package/dist/server/enginePaths.js.map +1 -0
  193. package/dist/server/folderPicker.d.ts +1 -0
  194. package/dist/server/folderPicker.js +54 -0
  195. package/dist/server/folderPicker.js.map +1 -0
  196. package/dist/server/manicAgent.d.ts +75 -0
  197. package/dist/server/manicAgent.js +476 -0
  198. package/dist/server/manicAgent.js.map +1 -0
  199. package/dist/server/manicEnv.d.ts +18 -0
  200. package/dist/server/manicEnv.js +64 -0
  201. package/dist/server/manicEnv.js.map +1 -0
  202. package/dist/server/promptStore.d.ts +11 -0
  203. package/dist/server/promptStore.js +85 -0
  204. package/dist/server/promptStore.js.map +1 -0
  205. package/dist/server/renderJobs.d.ts +54 -0
  206. package/dist/server/renderJobs.js +290 -0
  207. package/dist/server/renderJobs.js.map +1 -0
  208. package/dist/server/settings.d.ts +40 -0
  209. package/dist/server/settings.js +262 -0
  210. package/dist/server/settings.js.map +1 -0
  211. package/dist/server/smartDraw.d.ts +7 -0
  212. package/dist/server/smartDraw.js +88 -0
  213. package/dist/server/smartDraw.js.map +1 -0
  214. package/dist/server/workspace.d.ts +27 -0
  215. package/dist/server/workspace.js +172 -0
  216. package/dist/server/workspace.js.map +1 -0
  217. package/examples/.manic-output/40b6f3b9-7638-4c0e-bb4f-570d45d1b225/job.json +26 -0
  218. package/examples/.manic-output/993f3788-f75e-445c-ba45-c401907b3c02/job.json +26 -0
  219. package/examples/.manic-output/993f3788-f75e-445c-ba45-c401907b3c02/markers.json +13 -0
  220. package/examples/.manic-output/993f3788-f75e-445c-ba45-c401907b3c02/out.mp4 +0 -0
  221. package/examples/.manic-workbench-threads/thread_3ce7448a13f64f9e887d1bc8106a97a8.json +45 -0
  222. package/examples/.manic-workbench-threads/thread_d494cda29249477591056234719e4a3a.json +21 -0
  223. package/examples/.manic-workbench-threads/thread_e98ebdc225184ea5b8ddda8b44541f63.json +29 -0
  224. package/examples/README.md +35 -0
  225. package/examples/a-story-1.manic +222 -0
  226. package/examples/a-story.manic +100 -0
  227. package/examples/achromat-cinematic.manic +105 -0
  228. package/examples/achromat.manic +32 -0
  229. package/examples/aes-decrypt.manic +359 -0
  230. package/examples/aes-encrypt.manic +359 -0
  231. package/examples/aes-round.manic +70 -0
  232. package/examples/aes-story.manic +622 -0
  233. package/examples/ai-story.manic +118 -0
  234. package/examples/analysis.manic +53 -0
  235. package/examples/archimedes_pi.manic +89 -0
  236. package/examples/area_under_curve.manic +131 -0
  237. package/examples/art-rakkan.manic +69 -0
  238. package/examples/aspheric-lens.manic +32 -0
  239. package/examples/astronomical-watch.manic +96 -0
  240. package/examples/asymptote-randomwalk3-reference.manic +58 -0
  241. package/examples/asymptote-tiling-reference.manic +65 -0
  242. package/examples/aws-clustered-web-services.manic +186 -0
  243. package/examples/aws-event-processing-clusters-poc.manic +97 -0
  244. package/examples/aws-three-tier-web-application.manic +134 -0
  245. package/examples/band.manic +43 -0
  246. package/examples/banner.manic +37 -0
  247. package/examples/bayes.manic +27 -0
  248. package/examples/bellcurve.manic +41 -0
  249. package/examples/bfs_dfs.manic +35 -0
  250. package/examples/block-tackle.manic +26 -0
  251. package/examples/bloom-scope.manic +172 -0
  252. package/examples/boolean.manic +46 -0
  253. package/examples/boxplot-wave.manic +93 -0
  254. package/examples/boxplot.manic +43 -0
  255. package/examples/brace.manic +46 -0
  256. package/examples/brachistochrone-annotated.manic +51 -0
  257. package/examples/brachistochrone.manic +27 -0
  258. package/examples/bubble_sort.manic +41 -0
  259. package/examples/bullet-block-annotated.manic +48 -0
  260. package/examples/bullet-block.manic +11 -0
  261. package/examples/bullet-impact.manic +65 -0
  262. package/examples/bungee.manic +9 -0
  263. package/examples/c4-internet-banking-components.manic +33 -0
  264. package/examples/c4-internet-banking-containers.manic +29 -0
  265. package/examples/c4-internet-banking.manic +26 -0
  266. package/examples/c4-story.manic +171 -0
  267. package/examples/c4-test.manic +52 -0
  268. package/examples/c4-zoom.manic +69 -0
  269. package/examples/calculus-demo.manic +129 -0
  270. package/examples/calculus-one.manic +288 -0
  271. package/examples/captions.manic +31 -0
  272. package/examples/car-suspension-annotated.manic +57 -0
  273. package/examples/car-suspension.manic +8 -0
  274. package/examples/cart-pendulum.manic +11 -0
  275. package/examples/charts-bar-line.manic +26 -0
  276. package/examples/charts-column-race.manic +19 -0
  277. package/examples/charts-gdp-race.manic +43 -0
  278. package/examples/charts-german-elections.manic +28 -0
  279. package/examples/charts-line-race.manic +21 -0
  280. package/examples/circle-in-three.manic +156 -0
  281. package/examples/circle-thirds-no-triangle.manic +161 -0
  282. package/examples/clip-window.manic +34 -0
  283. package/examples/cloud-feathers.manic +50 -0
  284. package/examples/cloud-jellyfish-v2.manic +87 -0
  285. package/examples/cloud-jellyfish.manic +48 -0
  286. package/examples/cloud-kaleidoscope.manic +48 -0
  287. package/examples/cloud-koi.manic +51 -0
  288. package/examples/cloud-lissajous.manic +23 -0
  289. package/examples/cloud-medusae.manic +46 -0
  290. package/examples/cloud-phoenix.manic +49 -0
  291. package/examples/cloud-plumes.manic +47 -0
  292. package/examples/cloud-pottery.manic +104 -0
  293. package/examples/cloud-shells.manic +50 -0
  294. package/examples/cloud-starfield.manic +23 -0
  295. package/examples/cloud-wave-lattice.manic +23 -0
  296. package/examples/cloud-word.manic +31 -0
  297. package/examples/cloud3-ripple.manic +53 -0
  298. package/examples/cloud3-sphere.manic +26 -0
  299. package/examples/clt.manic +35 -0
  300. package/examples/collide-blocks-annotated.manic +45 -0
  301. package/examples/collide-blocks.manic +11 -0
  302. package/examples/compare-pendulum.manic +11 -0
  303. package/examples/complex-flowchart.manic +196 -0
  304. package/examples/compound-pulley.manic +25 -0
  305. package/examples/conics.manic +46 -0
  306. package/examples/coordinates.manic +52 -0
  307. package/examples/correlation.manic +35 -0
  308. package/examples/covariance.manic +30 -0
  309. package/examples/creator-affine-fern-growth.manic +72 -0
  310. package/examples/creator-bowl-to-saddle.manic +86 -0
  311. package/examples/creator-branch-counting-tree3.manic +77 -0
  312. package/examples/creator-chaos-game-fern.manic +72 -0
  313. package/examples/creator-circle-inversion-chain.manic +61 -0
  314. package/examples/creator-convex-hull-depth.manic +59 -0
  315. package/examples/creator-coordinate-worlds.manic +182 -0
  316. package/examples/creator-ellipse-reflection-property.manic +59 -0
  317. package/examples/creator-free-kicks.manic +261 -0
  318. package/examples/creator-geometry-language-showcase.manic +259 -0
  319. package/examples/creator-geometry-morph-promo.manic +151 -0
  320. package/examples/creator-heightmap-world.manic +130 -0
  321. package/examples/creator-hilbert3-spatial-index.manic +203 -0
  322. package/examples/creator-how-rocket-launch-works.manic +192 -0
  323. package/examples/creator-implicit-surface-parameterized.manic +51 -0
  324. package/examples/creator-incenter-dissection.manic +56 -0
  325. package/examples/creator-lattice-paths.manic +118 -0
  326. package/examples/creator-line-inversion.manic +49 -0
  327. package/examples/creator-lsystem-fractal-curve.manic +121 -0
  328. package/examples/creator-mandelbrot-escape-test.manic +58 -0
  329. package/examples/creator-monty-hall.manic +104 -0
  330. package/examples/creator-noise-story.manic +123 -0
  331. package/examples/creator-one-tile-pattern-story.manic +169 -0
  332. package/examples/creator-pathfinding.manic +82 -0
  333. package/examples/creator-point-to-plane-distance.manic +167 -0
  334. package/examples/creator-race-quiz.manic +76 -0
  335. package/examples/creator-randomwalk3-diffusion.manic +72 -0
  336. package/examples/creator-reflected-ellipse.manic +48 -0
  337. package/examples/creator-rule90-sierpinski.manic +64 -0
  338. package/examples/creator-three-shadows-of-a-curve.manic +48 -0
  339. package/examples/creator-trigonometry-one-angle.manic +307 -0
  340. package/examples/creator-v2-latex-algebra.manic +29 -0
  341. package/examples/creator-v2-latex-calculus.manic +37 -0
  342. package/examples/creator-v2-latex-physics.manic +29 -0
  343. package/examples/creator-v2-olympiad-geometry.manic +92 -0
  344. package/examples/creator-v2-options-socials.manic +21 -0
  345. package/examples/creator-v2-timers.manic +25 -0
  346. package/examples/creator-v2-timing-square.manic +25 -0
  347. package/examples/creator-v2-timing.manic +34 -0
  348. package/examples/creator-v2.manic +36 -0
  349. package/examples/creator-why-rockets-use-stages.manic +198 -0
  350. package/examples/creator-wrap-real-line.manic +51 -0
  351. package/examples/cubic-graphs.manic +432 -0
  352. package/examples/curve-features.manic +41 -0
  353. package/examples/definedmotion-fourier-gallery.manic +171 -0
  354. package/examples/derivative-of-ln-x.manic +194 -0
  355. package/examples/diagonalise.manic +56 -0
  356. package/examples/dijkstra.manic +29 -0
  357. package/examples/dimensions-unfold.manic +211 -0
  358. package/examples/disc-integration.manic +172 -0
  359. package/examples/double-incline.manic +9 -0
  360. package/examples/double-integral3.manic +43 -0
  361. package/examples/double-pendulum.manic +35 -0
  362. package/examples/double-spring.manic +9 -0
  363. package/examples/drop-mass.manic +25 -0
  364. package/examples/eigen3.manic +34 -0
  365. package/examples/equal_cuts.manic +44 -0
  366. package/examples/equation.manic +16 -0
  367. package/examples/equilateral.manic +57 -0
  368. package/examples/euler_line.manic +51 -0
  369. package/examples/exponential-shells.manic +188 -0
  370. package/examples/extrude3.manic +37 -0
  371. package/examples/factorial-flowchart.manic +69 -0
  372. package/examples/fibonacci-sphere.manic +57 -0
  373. package/examples/flow-lorenz.manic +47 -0
  374. package/examples/fourier-series-live-wave.manic +114 -0
  375. package/examples/fourier-square-wave-live.manic +114 -0
  376. package/examples/fractal_tree.manic +39 -0
  377. package/examples/frame3-grid-policies.manic +48 -0
  378. package/examples/ftc.manic +54 -0
  379. package/examples/function_graph.manic +54 -0
  380. package/examples/galton-board-process.manic +150 -0
  381. package/examples/gcp-clustered-web-services.manic +186 -0
  382. package/examples/gcp-message-collecting.manic +139 -0
  383. package/examples/geo-pythagoras-short.manic +119 -0
  384. package/examples/glsl-boxgrid.manic +105 -0
  385. package/examples/glsl-parameter.manic +30 -0
  386. package/examples/glsl-raymarch.manic +59 -0
  387. package/examples/glsl-shapes.manic +122 -0
  388. package/examples/gradient-descent-field.manic +116 -0
  389. package/examples/gradient-fastest-descent-shorts.manic +153 -0
  390. package/examples/gradient-fastest-descent.manic +125 -0
  391. package/examples/gradient-pendulum-shorts.manic +117 -0
  392. package/examples/gradient.manic +74 -0
  393. package/examples/graph.manic +45 -0
  394. package/examples/graph_moving.manic +67 -0
  395. package/examples/grid-astar.manic +15 -0
  396. package/examples/grid-life-soup.manic +31 -0
  397. package/examples/grid-life-zoo.manic +46 -0
  398. package/examples/grid-life.manic +19 -0
  399. package/examples/grid-wfc.manic +13 -0
  400. package/examples/growing-fractal-tree3.manic +58 -0
  401. package/examples/gun-shot.manic +82 -0
  402. package/examples/hashmap.manic +38 -0
  403. package/examples/heightmap3-world.manic +64 -0
  404. package/examples/heightmap3.manic +23 -0
  405. package/examples/hilbert-curve3-space-filling.manic +117 -0
  406. package/examples/hill_run.manic +71 -0
  407. package/examples/histogram.manic +43 -0
  408. package/examples/hotdog-taco.manic +147 -0
  409. package/examples/hue_wave.manic +35 -0
  410. package/examples/hypothesis.manic +32 -0
  411. package/examples/image.manic +29 -0
  412. package/examples/incircle_tangents.manic +64 -0
  413. package/examples/incline-bumper.manic +11 -0
  414. package/examples/incline-pulley.manic +11 -0
  415. package/examples/incline-showcase.manic +55 -0
  416. package/examples/inline-math.manic +16 -0
  417. package/examples/inscribed-angle-short.manic +56 -0
  418. package/examples/integral-sqrt-tanx.manic +255 -0
  419. package/examples/integrals.manic +274 -0
  420. package/examples/inverse-derivatives.manic +94 -0
  421. package/examples/k8s-cluster-components.manic +82 -0
  422. package/examples/k8s-stateful-architecture.manic +134 -0
  423. package/examples/k8s-three-tier.manic +146 -0
  424. package/examples/kapitza.manic +11 -0
  425. package/examples/latex-disintegration.manic +123 -0
  426. package/examples/lens-paper.manic +36 -0
  427. package/examples/lens-prescription.manic +33 -0
  428. package/examples/lens-system.manic +34 -0
  429. package/examples/lens.manic +31 -0
  430. package/examples/limit-infinity.manic +30 -0
  431. package/examples/limit.manic +33 -0
  432. package/examples/linear-algebra-3d.manic +50 -0
  433. package/examples/linear-algebra.manic +115 -0
  434. package/examples/linear-map.manic +39 -0
  435. package/examples/linear-map3.manic +33 -0
  436. package/examples/linear-system.manic +99 -0
  437. package/examples/linear_transform.manic +43 -0
  438. package/examples/linked_list.manic +38 -0
  439. package/examples/lln.manic +31 -0
  440. package/examples/loop-cinematic.manic +41 -0
  441. package/examples/loop-track.manic +11 -0
  442. package/examples/lorenz-attractor.manic +55 -0
  443. package/examples/lorenz-shells.manic +43 -0
  444. package/examples/lost-in-patterns.manic +149 -0
  445. package/examples/lsystem-asymptote-curves.manic +81 -0
  446. package/examples/manic-ml-activation-focus.manic +133 -0
  447. package/examples/manic-ml-cnn-edge-story.manic +102 -0
  448. package/examples/manic-ml-forward-pass.manic +93 -0
  449. package/examples/manic-ml-learning-step.manic +116 -0
  450. package/examples/manic-ml-logits-sampling.manic +112 -0
  451. package/examples/manic-ml-scalar-to-tensor.manic +143 -0
  452. package/examples/manic-ml-token-embedding.manic +110 -0
  453. package/examples/manic-ml-transformer-attention.manic +102 -0
  454. package/examples/manic-ml-transformer-block.manic +116 -0
  455. package/examples/manic-promo.manic +64 -0
  456. package/examples/map-attractor.manic +45 -0
  457. package/examples/mask-lens.manic +33 -0
  458. package/examples/matrix.manic +37 -0
  459. package/examples/matrix3.manic +101 -0
  460. package/examples/matrix_addition.manic +66 -0
  461. package/examples/matrix_addition_plane.manic +91 -0
  462. package/examples/maxwell-boltzmann-effusion-v2.manic +142 -0
  463. package/examples/maxwell-boltzmann-process.manic +86 -0
  464. package/examples/microservices-platform.manic +140 -0
  465. package/examples/molecule.manic +8 -0
  466. package/examples/morph-icons.manic +29 -0
  467. package/examples/morph.manic +29 -0
  468. package/examples/morph3.manic +49 -0
  469. package/examples/motion-flow-foundation.manic +148 -0
  470. package/examples/motion-graphics-v2-story.manic +189 -0
  471. package/examples/motion-graphics-v2.manic +81 -0
  472. package/examples/motion-graphics.manic +81 -0
  473. package/examples/multivariable3.manic +26 -0
  474. package/examples/mystory.manic +9 -0
  475. package/examples/newton.manic +39 -0
  476. package/examples/newtons-cradle.manic +10 -0
  477. package/examples/nine_point.manic +59 -0
  478. package/examples/noise-terrain.manic +16 -0
  479. package/examples/off-axis.manic +32 -0
  480. package/examples/onprem-advanced-web-service-v2.manic +196 -0
  481. package/examples/onprem-advanced-web-service.manic +175 -0
  482. package/examples/orthocenter.manic +63 -0
  483. package/examples/param3.manic +43 -0
  484. package/examples/parameter-journeys.manic +154 -0
  485. package/examples/parameterized-field-advection.manic +57 -0
  486. package/examples/parameterized-generated-families3.manic +83 -0
  487. package/examples/particles-flow.manic +61 -0
  488. package/examples/pascal-triangle.manic +92 -0
  489. package/examples/pendulum-annotated.manic +72 -0
  490. package/examples/pendulum-damped.manic +35 -0
  491. package/examples/pendulum.manic +38 -0
  492. package/examples/perfect-reel.manic +43 -0
  493. package/examples/pie.manic +41 -0
  494. package/examples/pieday.manic +113 -0
  495. package/examples/piston.manic +7 -0
  496. package/examples/popkorn-field.manic +38 -0
  497. package/examples/prism-cinematic.manic +36 -0
  498. package/examples/prism.manic +32 -0
  499. package/examples/probability.manic +57 -0
  500. package/examples/process-branching-dispatch.manic +71 -0
  501. package/examples/process-stream-observe.manic +54 -0
  502. package/examples/projection.manic +57 -0
  503. package/examples/prompt-test-10.manic +257 -0
  504. package/examples/prompt-test-11.manic +168 -0
  505. package/examples/prompt-test-12.manic +177 -0
  506. package/examples/prompt-test-13.manic +228 -0
  507. package/examples/prompt-test-14.manic +319 -0
  508. package/examples/prompt-test-15.manic +325 -0
  509. package/examples/prompt-test-16.manic +252 -0
  510. package/examples/prompt-test-2.manic +239 -0
  511. package/examples/prompt-test-3.manic +336 -0
  512. package/examples/prompt-test-4.manic +195 -0
  513. package/examples/prompt-test-5.manic +223 -0
  514. package/examples/prompt-test-6.manic +222 -0
  515. package/examples/prompt-test-7.manic +156 -0
  516. package/examples/prompt-test-8.manic +266 -0
  517. package/examples/prompt-test-9.manic +171 -0
  518. package/examples/prompt-test.manic +158 -0
  519. package/examples/pulley-annotated.manic +54 -0
  520. package/examples/pulley-paper.manic +52 -0
  521. package/examples/pulley-scale.manic +23 -0
  522. package/examples/pulley.manic +24 -0
  523. package/examples/quadratic-formula-continuity.manic +110 -0
  524. package/examples/quiz-euler.manic +52 -0
  525. package/examples/quiz-geometry-2.manic +107 -0
  526. package/examples/quiz-geometry.manic +108 -0
  527. package/examples/quiz-skins.manic +22 -0
  528. package/examples/raft-cm.manic +24 -0
  529. package/examples/ramp.manic +25 -0
  530. package/examples/ray-fan.manic +27 -0
  531. package/examples/raymarch-alpha.manic +39 -0
  532. package/examples/raymarch-boxgrid.manic +47 -0
  533. package/examples/raymarch-docker-latency.manic +74 -0
  534. package/examples/raymarch-metaballs.manic +37 -0
  535. package/examples/raymarch-sculpture.manic +39 -0
  536. package/examples/raymarch-shapes3.manic +31 -0
  537. package/examples/reactive-integral.manic +172 -0
  538. package/examples/reactive-math-journey.manic +185 -0
  539. package/examples/reactive-math-notation.manic +150 -0
  540. package/examples/reactive-multiformat.manic +130 -0
  541. package/examples/reactive-world.manic +111 -0
  542. package/examples/refraction-paper.manic +40 -0
  543. package/examples/refraction.manic +32 -0
  544. package/examples/resonance.manic +10 -0
  545. package/examples/rewrite-exponential-cubic.manic +141 -0
  546. package/examples/rewrite-integration.manic +199 -0
  547. package/examples/riemann_rainbow.manic +61 -0
  548. package/examples/riemann_readout.manic +61 -0
  549. package/examples/robot-arm.manic +25 -0
  550. package/examples/rref.manic +48 -0
  551. package/examples/second-law-thermodynamics.manic +385 -0
  552. package/examples/series-parallel-springs.manic +8 -0
  553. package/examples/serverless-processing.manic +145 -0
  554. package/examples/shader-cellular.manic +35 -0
  555. package/examples/shader-fractal.manic +45 -0
  556. package/examples/shader-fx.manic +34 -0
  557. package/examples/shader-glitch-grid.manic +55 -0
  558. package/examples/shader-parameter.manic +25 -0
  559. package/examples/shader-patterns.manic +37 -0
  560. package/examples/shader-plasma.manic +43 -0
  561. package/examples/shader-shapes-dsl.manic +46 -0
  562. package/examples/shader-shapes.manic +37 -0
  563. package/examples/shader-warp.manic +22 -0
  564. package/examples/shapes-howto.manic +411 -0
  565. package/examples/sine_wave.manic +42 -0
  566. package/examples/skew.manic +40 -0
  567. package/examples/smoke.rs +57 -0
  568. package/examples/solids3.manic +22 -0
  569. package/examples/some-story.manic +299 -0
  570. package/examples/spinning-cylinder-flow.manic +87 -0
  571. package/examples/spline.manic +21 -0
  572. package/examples/spot-diagram.manic +32 -0
  573. package/examples/spring-annotated.manic +60 -0
  574. package/examples/spring-chain.manic +11 -0
  575. package/examples/spring-damped.manic +33 -0
  576. package/examples/spring-incline.manic +10 -0
  577. package/examples/spring-paper.manic +46 -0
  578. package/examples/spring-pendulum.manic +14 -0
  579. package/examples/spring.manic +33 -0
  580. package/examples/sqrt-tanx.manic +217 -0
  581. package/examples/ssl-handshake-sdf.manic +116 -0
  582. package/examples/stack_queue.manic +53 -0
  583. package/examples/statistics.manic +60 -0
  584. package/examples/story-addressable-asset-cues.manic +71 -0
  585. package/examples/story-dependent-chain-history.manic +56 -0
  586. package/examples/story-living-dependency-cloud.manic +50 -0
  587. package/examples/story-time-varying-field3.manic +57 -0
  588. package/examples/story.manic +4 -0
  589. package/examples/string-art-breath.manic +70 -0
  590. package/examples/string-wave.manic +10 -0
  591. package/examples/summary.manic +48 -0
  592. package/examples/svg-howto.manic +172 -0
  593. package/examples/svg-import.manic +18 -0
  594. package/examples/systems-architecture-poc.manic +92 -0
  595. package/examples/systems-arrow-patterns.manic +151 -0
  596. package/examples/systems-foundation.manic +71 -0
  597. package/examples/systems-rabbitmq-consumers.manic +118 -0
  598. package/examples/table.manic +39 -0
  599. package/examples/table_braces.manic +54 -0
  600. package/examples/tangent-length-short.manic +57 -0
  601. package/examples/tangent.manic +29 -0
  602. package/examples/tangents.manic +54 -0
  603. package/examples/taylor.manic +44 -0
  604. package/examples/terminal_boot.manic +40 -0
  605. package/examples/test.manic +61 -0
  606. package/examples/text-guide.manic +304 -0
  607. package/examples/textbook-coordinate-worlds.manic +129 -0
  608. package/examples/textbook-doubly-list.manic +33 -0
  609. package/examples/textbook-function-to-solid.manic +126 -0
  610. package/examples/textbook-geometry-dimension-reduction.manic +129 -0
  611. package/examples/textbook-incline-fbd.manic +43 -0
  612. package/examples/textbook-length-area-volume.manic +137 -0
  613. package/examples/textbook-matrix-inverses.manic +172 -0
  614. package/examples/textbook-pulley.manic +35 -0
  615. package/examples/textbook-statistical-dimensions.manic +151 -0
  616. package/examples/textbook-tension.manic +39 -0
  617. package/examples/textbook-watermelon-sections.manic +216 -0
  618. package/examples/thales-semicircle-short.manic +53 -0
  619. package/examples/three-d-v2-lab.manic +83 -0
  620. package/examples/three-d-v2-story.manic +106 -0
  621. package/examples/three-d-v2.manic +69 -0
  622. package/examples/three_d.manic +39 -0
  623. package/examples/timing-v2-scene.manic +47 -0
  624. package/examples/trajectory.manic +28 -0
  625. package/examples/transform_copy.manic +35 -0
  626. package/examples/transforms.manic +54 -0
  627. package/examples/trapped-light-dimensions.manic +226 -0
  628. package/examples/tree-of-leaves.manic +215 -0
  629. package/examples/triangle.manic +68 -0
  630. package/examples/two_person_walk.manic +296 -0
  631. package/examples/two_pointer.manic +32 -0
  632. package/examples/type-to-sdf.manic +139 -0
  633. package/examples/typewriter.manic +28 -0
  634. package/examples/vector_field.manic +32 -0
  635. package/examples/vertical-spring.manic +10 -0
  636. package/examples/volume3.manic +21 -0
  637. package/examples/volumes-solid-of-revolution.manic +111 -0
  638. package/examples/walk.manic +154 -0
  639. package/examples/wheel-duo.manic +91 -0
  640. package/examples/wheel-radial.manic +78 -0
  641. package/examples/wheel-square.manic +83 -0
  642. package/examples/wireframe-spheres.manic +37 -0
  643. package/examples/zeroth-law-thermodynamics.manic +269 -0
  644. package/package.json +59 -0
@@ -0,0 +1,56 @@
1
+ // inscribed-angle-short — 9:16 quiz Short (~23s): the inscribed angle theorem.
2
+ // Central angle 140° in gold, mystery inscribed angle in cyan; the half-rule
3
+ // answer stamps in at the reveal.
4
+ title("The Inscribed Angle Rule");
5
+ canvas("9:16");
6
+ template("black");
7
+
8
+ creator(me, "@anish2good name=Science_Lab yt=zarigatongy x=@anish2good web=8gwifi.org/manic footer=social accent=cyan");
9
+
10
+ quiz(q, `Central angle $\angle AOB = 140^\circ$. What is the inscribed angle at $C$?`, "layout=media-first");
11
+ option(q, "40°");
12
+ option(q, "70°", correct);
13
+ option(q, "100°");
14
+ option(q, "140°");
15
+ timing(q, "ask=4 options=4 think=8 reveal=3 hold=4");
16
+ explain(q, `The inscribed angle is always HALF its central angle: $140^\circ \div 2 = 70^\circ$.`);
17
+
18
+ // ---------- the figure ----------
19
+ point(O, (cx, 900), "O"); size(O.label, 30); hidden(O);
20
+ point(A, (cx + 174, 837), "A"); size(A.label, 34); hidden(A);
21
+ point(B, (cx - 174, 837), "B"); size(B.label, 34); hidden(B);
22
+ point(C, (cx, 1085), "C"); size(C.label, 34); hidden(C);
23
+ circle2(circ, O, A); outlined(circ); stroke(circ, 3); untraced(circ);
24
+ segment(oa, O, A); stroke(oa, 4); color(oa, gold); untraced(oa);
25
+ segment(ob, O, B); stroke(ob, 4); color(ob, gold); untraced(ob);
26
+ segment(ca, C, A); stroke(ca, 4); color(ca, cyan); untraced(ca);
27
+ segment(cb, C, B); stroke(cb, 4); color(cb, cyan); untraced(cb);
28
+ anglemark(mo, A, O, B); color(mo, gold); hidden(mo);
29
+ anglemark(mi, A, C, B); color(mi, cyan); hidden(mi);
30
+ text(l140, (cx, 830), "140°"); size(l140, 32); color(l140, gold); hidden(l140);
31
+ text(l70, (cx, 1038), "70°"); size(l70, 32); color(l70, cyan); hidden(l70);
32
+
33
+ socials(me);
34
+
35
+ // ================= timeline =================
36
+ par {
37
+ run(q);
38
+ seq {
39
+ wait(0.8);
40
+ show(O, 0.4);
41
+ draw(circ, 1.2);
42
+ par { show(A, 0.4); show(B, 0.4); }
43
+ par { draw(oa, 0.8); draw(ob, 0.8); }
44
+ par { show(mo, 0.4); show(l140, 0.4); }
45
+ show(C, 0.4);
46
+ par { draw(ca, 0.9); draw(cb, 0.9); }
47
+ show(mi, 0.4);
48
+ pulse(mi, 0.8);
49
+ // hold through the countdown; the answer stamps in at the reveal (t = 16s)
50
+ wait(8.1);
51
+ show(l70, 0.4);
52
+ flash(mi, cyan);
53
+ cue(pop);
54
+ }
55
+ }
56
+ wait(0.5);
@@ -0,0 +1,255 @@
1
+ // ============================================================================
2
+ // integral-sqrt-tanx.manic — ∫ √(tan P) dP by PURE GEOMETRY
3
+ // Companion to sqrt-tanx.manic. Storyboard: the handwritten circle+hyperbola
4
+ // derivation (x²+y²=2 meets x²−y²=2; A(t)−H(t) recovers the integrand).
5
+ // ----------------------------------------------------------------------------
6
+ // THE PROBLEM: √(tan P) is a length. What is its antiderivative?
7
+ //
8
+ // THE GEOMETRY (one diagram, two curves of "radius" √2):
9
+ // · circle x² + y² = 2 → A(t) = arcsin(√2 sin t)
10
+ // · hyperbola x² − y² = 2 → H(t) = arcosh(√2 cos t)
11
+ // · substitution P = t + π/4 (so t ∈ (0, π/4) ⇒ P ∈ (π/4, π/2))
12
+ //
13
+ // THE TRUTH:
14
+ // dA − dH = √2 · √(tan P) · dP
15
+ // therefore
16
+ // ∫ √(tan P) dP = (1/√2)(A(t) − H(t)) + C
17
+ //
18
+ // Colours (expanded palette): teal = circle/A, coral = hyperbola/H,
19
+ // violet = the integral, mint = the moving point, gold = the hook.
20
+ //
21
+ // manic examples/integral-sqrt-tanx.manic
22
+ // manic examples/integral-sqrt-tanx.manic --still 20
23
+ // ============================================================================
24
+
25
+ title("∫ √(tan P) dP — Circle Meets Hyperbola");
26
+ canvas("16:9");
27
+ template("blank");
28
+
29
+ // ---- stage ----
30
+ circle(well, (cx, 400), 360);
31
+ filled(well);
32
+ gradient(well, panel, void, radial);
33
+ opacity(well, 0.5);
34
+
35
+ // ============================================================================
36
+ // THE DIAGRAM — circle x²+y²=2 and hyperbola x²−y²=2
37
+ // Screen: origin at (ox,oy), scale s px per unit. Radius √2 ≈ 1.414.
38
+ // ============================================================================
39
+ let ox = 340;
40
+ let oy = 400;
41
+ let s = 130; // px per math-unit
42
+ let R = s*sqrt(2); // circle radius = √2
43
+ // a friendly t inside (0, π/4): t = 0.40 rad ≈ 23°
44
+ let t = 0.40;
45
+ let P = t + pi/4; // ≈ 1.185 rad ≈ 68°
46
+ // point C on the circle: (√2 cos t, √2 sin t)
47
+ let Cx = ox + s*sqrt(2)*cos(t);
48
+ let Cy = oy - s*sqrt(2)*sin(t);
49
+ // foot on the x-axis and the "hyperbola x" = √2 cosh u with cosh u = √2 cos t?
50
+ // From notes: X = √2 cos t = cosh H, so the hyperbola vertex is at x=√2.
51
+ // Point on right branch with x = √2 cos t... wait cosh H = √2 cos t, so
52
+ // x_hyp = cosh H = √2 cos t (in math units where a=1 for cosh param form
53
+ // of x²−y²=1). Our hyperbola is x²−y²=2 = (x/√2)² − (y/√2)², so
54
+ // parametric: x = √2 cosh u, y = √2 sinh u. And cosh H = √2 cos t? Notes say
55
+ // cosh(H) = X = √2 cos t — that would require cosh H ≤ √2, H = arcosh(√2 cos t).
56
+ // For the diagram, mark the circle point and the matching hyperbola x.
57
+
58
+ // axes
59
+ line(axX, (ox - R - 40, oy), (ox + R + 120, oy));
60
+ color(axX, dim); stroke(axX, 1.5); untraced(axX); hidden(axX);
61
+ line(axY, (ox, oy + R + 50), (ox, oy - R - 60));
62
+ color(axY, dim); stroke(axY, 1.5); untraced(axY); hidden(axY);
63
+
64
+ // circle x² + y² = 2 — OUTLINED only. `circle` defaults to filled; a solid
65
+ // disc hides axes and labels underneath (engine-test: never fill constructions).
66
+ circle(circ, (ox, oy), R);
67
+ outlined(circ); outline(circ, teal); stroke(circ, 3.5); untraced(circ); hidden(circ);
68
+
69
+ // hyperbola x² − y² = 2 → a = b = √2 (in math units) → a_px = R
70
+ hyperbola(hyp, (ox, oy), R, R, 1.15);
71
+ color(hyp, coral); stroke(hyp, 3); untraced(hyp);
72
+ hidden(hyp.r); hidden(hyp.l);
73
+
74
+ // origin: thin open ring (tiny r + thick stroke reads as a filled blob)
75
+ circle(O, (ox, oy), 7);
76
+ outlined(O); color(O, fg); stroke(O, 1.5); hidden(O);
77
+
78
+ // contact point C: dashed open circle so circle + projections show through.
79
+ // Keep radius >> stroke so the interior stays empty (textbook marker).
80
+ circle(C, (Cx, Cy), 12);
81
+ outlined(C); color(C, mint); stroke(C, 2); dashed(C, 3.5, 2.8); untraced(C); hidden(C);
82
+
83
+ // radius toward C — a LINE, not an arrow: arrowheads are filled discs and
84
+ // hide the open marker at the contact point (engine-test visibility rule)
85
+ line(ray, (ox, oy), (Cx, Cy));
86
+ color(ray, mint); stroke(ray, 2.5); untraced(ray); hidden(ray);
87
+
88
+ // horizontal from C to y-axis? notes have Y = √2 sin t as height
89
+ line(ht, (ox, Cy), (Cx, Cy));
90
+ color(ht, violet); stroke(ht, 2); dashed(ht, 8, 6); untraced(ht); hidden(ht);
91
+ // vertical drop to x-axis
92
+ line(vt, (Cx, oy), (Cx, Cy));
93
+ color(vt, teal); stroke(vt, 2); dashed(vt, 8, 6); untraced(vt); hidden(vt);
94
+
95
+ // angle mark — textbook style: a thin ARC, never a filled disc (fills hide axes)
96
+ arc(wedge, (ox, oy), R*0.38, 0, -t*180/pi);
97
+ color(wedge, violet); stroke(wedge, 2.5); untraced(wedge); hidden(wedge);
98
+
99
+ // labels on the diagram
100
+ text(labO, (ox - 16, oy + 22), "O"); size(labO, 18); color(labO, dim); hidden(labO);
101
+ text(labC, (Cx + 22, Cy - 22), "C(t)"); size(labC, 20); color(labC, mint); hidden(labC);
102
+ text(labT, (ox + 42, oy - 22), "t"); size(labT, 22); color(labT, violet); hidden(labT);
103
+ text(labCirc, (ox - 20, oy - R - 24), "x² + y² = 2"); size(labCirc, 20); color(labCirc, teal); hidden(labCirc);
104
+ text(labHyp, (ox + R + 55, oy + 40), "x² − y² = 2"); size(labHyp, 20); color(labHyp, coral); hidden(labHyp);
105
+
106
+ // region hint: dashed circle (not a filled disc, not just a short arc)
107
+ circle(zone, (ox + R*0.42, oy - R*0.18), R*0.38);
108
+ outlined(zone); color(zone, indigo); stroke(zone, 2); dashed(zone, 7, 5);
109
+ untraced(zone); hidden(zone);
110
+
111
+ // ============================================================================
112
+ // RIGHT — the algebraic spine, rewritten live
113
+ // ============================================================================
114
+ equation(eqP, (920, 150), `P=t+\tfrac{\pi}{4}`, 32);
115
+ color(eqP, gold); hidden(eqP);
116
+
117
+ equation(eqA, (920, 230), `A(t)=\sin^{-1}(\sqrt{2}\sin t)`, 28);
118
+ color(eqA, teal); hidden(eqA);
119
+
120
+ equation(eqH, (920, 300), `H(t)=\cosh^{-1}(\sqrt{2}\cos t)`, 28);
121
+ color(eqH, coral); hidden(eqH);
122
+
123
+ equation(eqD, (920, 390), `dA-dH=\sqrt{2}\,\sqrt{\tan P}\,dP`, 28);
124
+ color(eqD, violet); hidden(eqD);
125
+
126
+ equation(eqI, (920, 480), `\int\sqrt{\tan P}\,dP=\tfrac{1}{\sqrt{2}}(A-H)+C`, 30);
127
+ color(eqI, mint); hidden(eqI);
128
+
129
+ // final closed form (boxed punchline)
130
+ equation(eqF, (920, 580), `\tfrac{1}{\sqrt{2}}\Big(\sin^{-1}(\sqrt{2}\sin(P-\tfrac{\pi}{4}))-\cosh^{-1}(\sqrt{2}\cos(P-\tfrac{\pi}{4}))\Big)+C`, 22);
131
+ color(eqF, gold); hidden(eqF);
132
+
133
+ // ============================================================================
134
+ // THE CURVE — √(tan x) on (π/4, ~1.4), then its antiderivative via ln-form of acosh
135
+ // ============================================================================
136
+ axes(ax, (920, 400), 300, 240);
137
+ hidden(ax);
138
+ // integrand (same spirit as the companion film)
139
+ plot(integrand, (920, 400), 90, 70, "sqrt(tan(x))", (0.85, 1.45));
140
+ stroke(integrand, 4); untraced(integrand); hidden(integrand);
141
+ gradient(integrand, teal, violet, coral, 270);
142
+
143
+ // antiderivative F(P) = (1/√2)(asin(√2 sin(P-π/4)) - acosh(√2 cos(P-π/4)))
144
+ // acosh(u) = ln(u + sqrt(u*u - 1))
145
+ plot(anti, (920, 400), 90, 55,
146
+ "(asin(sqrt(2)*sin(x-pi/4)) - ln(sqrt(2)*cos(x-pi/4) + sqrt(2*cos(x-pi/4)*cos(x-pi/4) - 1)))/sqrt(2)",
147
+ (0.85, 1.45));
148
+ stroke(anti, 4); untraced(anti); hidden(anti);
149
+ gradient(anti, mint, indigo, violet, 270);
150
+
151
+ // ============================================================================
152
+ // TYPOGRAPHY
153
+ // ============================================================================
154
+ caption(q, "how do you integrate a square root of a tangent?", (cx, 52), 30, gold);
155
+ equation(hook, (cx, 105), `\int\sqrt{\tan P}\,dP`, 42);
156
+ color(hook, violet); hidden(hook);
157
+ text(cap, (cx, h - 34), ""); size(cap, 20); color(cap, dim); display(cap);
158
+
159
+ // ============================================================================
160
+ // SCRIPT
161
+ // ============================================================================
162
+
163
+ // 1 — HOOK
164
+ say(cap, "√(tan P) is a length — we proved that. Now integrate it.", 0.4);
165
+ wordpop(q, 0.14);
166
+ wait(0.25);
167
+ show(hook, 0.5);
168
+ wait(0.6);
169
+
170
+ // 2 — THE SUBSTITUTION
171
+ say(cap, "one substitution opens the geometry: P = t + π/4", 0.4);
172
+ show(eqP, 0.5);
173
+ flash(eqP, gold);
174
+ wait(0.7);
175
+
176
+ // 3 — THE STAGE: two curves of the same "2"
177
+ say(cap, "draw two curves that share the constant 2 — a circle and a hyperbola", 0.4);
178
+ par { show(axX, 0.05); show(axY, 0.05); }
179
+ par { draw(axX, 0.4); draw(axY, 0.4); }
180
+ show(circ, 0.05); draw(circ, 1.0);
181
+ show(labCirc, 0.3); show(O, 0.3); show(labO, 0.3);
182
+ wait(0.3);
183
+ show(hyp.r, 0.05); show(hyp.l, 0.05);
184
+ draw(hyp.r, 1.0); draw(hyp.l, 1.0);
185
+ show(labHyp, 0.3);
186
+ wait(0.5);
187
+
188
+ say(cap, "circle: x² + y² = 2. hyperbola: x² − y² = 2. Same 2 — intentional.", 0.4);
189
+ pulse(circ); pulse(hyp.r);
190
+ wait(0.7);
191
+
192
+ // 4 — THE MOVING POINT
193
+ say(cap, "park a point C(t) = (√2 cos t, √2 sin t) on the circle — t < π/4", 0.4);
194
+ show(wedge, 0.05); draw(wedge, 0.45); show(labT, 0.3);
195
+ show(ray, 0.05); draw(ray, 0.7);
196
+ show(C, 0.05); draw(C, 0.4); show(labC, 0.3);
197
+ show(ht, 0.05); show(vt, 0.05);
198
+ draw(ht, 0.5); draw(vt, 0.5);
199
+ show(zone, 0.05); draw(zone, 0.6);
200
+ wait(0.6);
201
+
202
+ // 5 — A(t) FROM THE CIRCLE
203
+ say(cap, "from the y-coordinate: A(t) = arcsin(√2 sin t) — an angle on that circle", 0.4);
204
+ show(eqA, 0.5);
205
+ flash(eqA, teal);
206
+ wait(0.8);
207
+
208
+ // 6 — H(t) FROM THE HYPERBOLA
209
+ say(cap, "from the x-coordinate: H(t) = arcosh(√2 cos t) — a hyperbolic angle", 0.4);
210
+ show(eqH, 0.5);
211
+ flash(eqH, coral);
212
+ wait(0.8);
213
+
214
+ // 7 — THE DIFFERENTIAL IDENTITY
215
+ say(cap, "differentiate both — their difference IS the integrand", 0.4);
216
+ show(eqD, 0.6);
217
+ flash(eqD, violet);
218
+ wait(0.5);
219
+ say(cap, "dA − dH = √2 · √(tan P) · dP — geometry differentiated", 0.4);
220
+ wait(1.0);
221
+
222
+ // 8 — INTEGRATE
223
+ recolor(cap, mint);
224
+ say(cap, "integrate both sides — the √2 cancels into the prefactor", 0.4);
225
+ show(eqI, 0.6);
226
+ pulse(eqI);
227
+ wait(0.9);
228
+
229
+ // 9 — CLOSED FORM
230
+ recolor(cap, violet);
231
+ say(cap, "substitute t = P − π/4 back — the antiderivative in closed form", 0.4);
232
+ show(eqF, 0.7);
233
+ flash(eqF, violet);
234
+ wait(1.0);
235
+
236
+ // 10 — SEE IT: integrand then antiderivative
237
+ recolor(cap, dim);
238
+ say(cap, "the integrand √(tan x) climbing toward π/2", 0.4);
239
+ par {
240
+ fade(eqA, 0.35); fade(eqH, 0.35); fade(eqD, 0.35); fade(eqI, 0.35); fade(eqF, 0.35);
241
+ fade(eqP, 0.35);
242
+ }
243
+ show(ax, 0.4);
244
+ show(integrand, 0.05); draw(integrand, 1.8);
245
+ wait(0.5);
246
+
247
+ say(cap, "and its antiderivative — (1/√2)(A − H) — the circle minus the hyperbola", 0.4);
248
+ show(anti, 0.05); draw(anti, 2.0);
249
+ flash(anti, mint);
250
+ wait(0.8);
251
+
252
+ // 11 — POINT
253
+ recolor(cap, teal);
254
+ say(cap, "a hard integral, solved because two curves of the same 2 were waiting", 0.4);
255
+ wait(1.8);
@@ -0,0 +1,274 @@
1
+ title("Ways to Integrate");
2
+ canvas(1280, 720);
3
+ template("black");
4
+
5
+ // ---------- layout constants ----------
6
+ let gx = cx - 340; // graph origin (math x = 0)
7
+ let gy = h - 160; // graph baseline (math y = 0)
8
+ let sx = 170; // px per x-unit
9
+ let sy = 100; // px per y-unit
10
+
11
+ // ---------- HUD: headings & captions (sticky = survive camera moves) ----------
12
+ text(head, (cx, 60), "Ways to Integrate"); display(head); cursor(head); sticky(head);
13
+ text(t1, (cx, 122), "1. Riemann - slice the domain"); size(t1, 30); color(t1, cyan); hidden(t1); sticky(t1);
14
+ text(t2, (cx, 122), "2. Lebesgue - slice the range"); size(t2, 30); color(t2, gold); hidden(t2); sticky(t2);
15
+ text(t3, (cx, 122), "3. Henstock-Kurzweil - slice with a gauge"); size(t3, 30); color(t3, magenta); hidden(t3); sticky(t3);
16
+
17
+ caption(in1, "Riemann - vertical strips of equal width", (cx, cy - 70), 32, cyan); hidden(in1);
18
+ caption(in2, "Lebesgue - horizontal layers weighed by measure", (cx, cy), 32, gold); hidden(in2);
19
+ caption(in3, "Henstock-Kurzweil - strip widths set by a gauge", (cx, cy + 70), 32, magenta); hidden(in3);
20
+
21
+ text(cap, (cx, h - 42), ""); size(cap, 26); sticky(cap);
22
+
23
+ // ---------- act wipes: glowing verticals that sweep the frame between acts ----------
24
+ line(wipe1, (-40, 140), (-40, h - 90)); stroke(wipe1, 4); color(wipe1, gold); glow(wipe1, 14);
25
+ line(wipe2, (-40, 140), (-40, h - 90)); stroke(wipe2, 4); color(wipe2, magenta); glow(wipe2, 14);
26
+ line(wipe3, (-40, 140), (-40, h - 90)); stroke(wipe3, 4); glow(wipe3, 14);
27
+
28
+ // ---------- axes ----------
29
+ arrow(xax, (gx - 30, gy), (gx + 4*sx + 50, gy)); untraced(xax); stroke(xax, 3);
30
+ arrow(yax, (gx, gy + 30), (gx, 175)); untraced(yax); stroke(yax, 3);
31
+ text(xl0, (gx, gy + 26), "0"); size(xl0, 22); color(xl0, dim); hidden(xl0);
32
+ text(xl4, (gx + 4*sx, gy + 26), "4"); size(xl4, 22); color(xl4, dim); hidden(xl4);
33
+
34
+ // ---------- the smooth bump (acts 1 & 2) ----------
35
+ plot(fplot, (gx, gy), sx, sy, "3*exp(-((x-2)^2))", (0, 4));
36
+ untraced(fplot); stroke(fplot, 4); gradient(fplot, blue, cyan, gold, 270);
37
+ dot(rider, (gx, gy), 7); color(rider, gold); glow(rider, 8); hidden(rider);
38
+
39
+ // Riemann: 8 coarse strips (declared 26px low, they RISE into place)
40
+ // + the SAMPLE DOTS f(x_i*) riding the curve top - the star of the definition
41
+ for i in 0..8 {
42
+ let xm = (i + 0.5)*0.5;
43
+ let hgt = 3*exp(-((xm - 2)^2));
44
+ rect(rc{i}, (gx + xm*sx, gy - hgt*sy/2 + 26), 0.5*sx - 3, hgt*sy);
45
+ color(rc{i}, cyan); opacity(rc{i}, 0.55); tag(rc{i}, coarse);
46
+ dot(sm{i}, (gx + xm*sx, gy - hgt*sy), 5);
47
+ color(sm{i}, cyan); glow(sm{i}, 6); tag(sm{i}, samples);
48
+ }
49
+ hidden(coarse); hidden(samples);
50
+
51
+ // Riemann: 32 fine strips
52
+ for i in 0..32 {
53
+ let xm = (i + 0.5)*0.125;
54
+ let hgt = 3*exp(-((xm - 2)^2));
55
+ rect(rf{i}, (gx + xm*sx, gy - hgt*sy/2), 0.125*sx - 2, hgt*sy);
56
+ color(rf{i}, cyan); opacity(rf{i}, 0.7); tag(rf{i}, fine);
57
+ }
58
+ hidden(fine);
59
+
60
+ // the limit: swept exact area + live integral readout
61
+ area(ar, fplot, 0, 0); color(ar, cyan); opacity(ar, 0.35);
62
+ integral(intg, fplot, 0, 0, (gx + 4*sx - 40, 265)); hidden(intg);
63
+
64
+ // the pivot strip: one vertical slice that ROTATES into a horizontal one
65
+ rect(pv, (gx + 2*sx, gy - 1.5*sy), 42, 3*sy); color(pv, cyan); opacity(pv, 0.7); hidden(pv);
66
+
67
+ // Lebesgue: 10 horizontal layers (declared offset sideways, they SLIDE in alternating)
68
+ for j in 0..10 {
69
+ let ym = (j + 0.5)*0.3;
70
+ let hf = sqrt(ln(3/ym));
71
+ let jm = j - 2*floor(j/2);
72
+ let xoff = 180*jm - 90;
73
+ rect(ls{j}, (gx + 2*sx - xoff, gy - ym*sy), 2*hf*sx, 0.3*sy - 2);
74
+ color(ls{j}, gold); opacity(ls{j}, 0.55); tag(ls{j}, layers);
75
+ }
76
+ hidden(layers);
77
+ // the level scanner: a dashed line that sweeps UP through the layers
78
+ line(lev, (gx, gy - 0.15*sy), (gx + 4*sx, gy - 0.15*sy));
79
+ dashed(lev); color(lev, gold); stroke(lev, 2); hidden(lev);
80
+
81
+ // ---------- the spiky function (act 3) ----------
82
+ plot(gplot, (gx, gy), sx, sy, "1.1+1.7*exp(-40*((x-3)^2))", (0, 4));
83
+ untraced(gplot); stroke(gplot, 4); gradient(gplot, teal, magenta, 270);
84
+ dot(rider2, (gx, gy), 7); color(rider2, magenta); glow(rider2, 8); hidden(rider2);
85
+
86
+ // the gauge ITSELF, drawn as a real function: delta(x) dips where f spikes
87
+ plot(dplot, (gx, gy), sx, 60, "0.55-0.45*exp(-20*((x-3)^2))", (0, 4));
88
+ untraced(dplot); dashed(dplot); stroke(dplot, 2); color(dplot, magenta); opacity(dplot, 0.7);
89
+ text(dlab, (gx + 4*sx + 34, gy - 33), `$\delta(x)$`); size(dlab, 24); color(dlab, magenta); hidden(dlab);
90
+
91
+ // uniform cells first (they rise in) - two of them will FAIL at the spike
92
+ for i in 0..8 {
93
+ let xm = (i + 0.5)*0.5;
94
+ let hgt = 1.1 + 1.7*exp(-40*((xm - 3)^2));
95
+ rect(hku{i}, (gx + xm*sx, gy - hgt*sy/2 + 26), 0.5*sx - 3, hgt*sy);
96
+ color(hku{i}, teal); opacity(hku{i}, 0.5); tag(hku{i}, hk);
97
+ }
98
+ hidden(hk);
99
+
100
+ // gauge-fine cells + their TAG POINTS t_i pinned on the curve
101
+ for i in 0..10 {
102
+ let xm = 2.5 + (i + 0.5)*0.1;
103
+ let hgt = 1.1 + 1.7*exp(-40*((xm - 3)^2));
104
+ rect(nk{i}, (gx + xm*sx, gy - hgt*sy/2), 0.1*sx - 2, hgt*sy);
105
+ color(nk{i}, magenta); opacity(nk{i}, 0.75); tag(nk{i}, gauge); tag(nk{i}, hk);
106
+ dot(tg{i}, (gx + xm*sx, gy - hgt*sy), 3);
107
+ color(tg{i}, magenta); glow(tg{i}, 5); tag(tg{i}, tgd);
108
+ }
109
+ hidden(gauge); hidden(tgd);
110
+ bracelabel(bnar, (gx + 2.5*sx, gy + 16), (gx + 3.5*sx, gy + 16), `gauge $\delta(x)$ shrinks here`, 14);
111
+ color(bnar, magenta); hidden(bnar);
112
+
113
+ // ---------- equations (each one LIVES: it rewrites, then turns to dust) ----------
114
+ equation(eqR, (cx, 190), `S_{8} \;=\; \sum_{i=1}^{8} f(x_i^{*})\,\textcolor{cyan}{\Delta x}`, 40); hidden(eqR); sticky(eqR);
115
+ equation(eqL, (cx, 190), `\text{layer}_j \;=\; \textcolor{gold}{\mu\{\,f > t_j\,\}}\cdot\Delta t`, 40); hidden(eqL); sticky(eqL);
116
+ equation(eqH, (cx, 190), `\sum_i f(\textcolor{magenta}{t_i})\,\Delta x_i`, 38); hidden(eqH); sticky(eqH);
117
+ equation(eqS, (cx, 250), `\textcolor{cyan}{\text{Riemann}} \;\subsetneq\; \textcolor{gold}{\text{Lebesgue}} \;\subsetneq\; \textcolor{magenta}{\text{Henstock-Kurzweil}}`, 44); hidden(eqS); sticky(eqS); z(eqS, 10);
118
+
119
+ // ---------- finale confetti + triptych reprise of the three motifs ----------
120
+ circle(confbox, (cx, 290), 90); hidden(confbox);
121
+ particles(conf, confbox, 24, 4, 11, "ring"); color(conf, gold); hidden(conf);
122
+
123
+ let mxr = cx - 380;
124
+ let mxh = cx + 380;
125
+ let myb = 490;
126
+ // mini Riemann: a tiny staircase of vertical strips
127
+ for i in 0..6 {
128
+ let xm = (i + 0.5)/3;
129
+ let hgt = 76*exp(-2*((xm - 1)^2));
130
+ rect(mr{i}, (mxr - 110 + xm*110, myb - hgt/2), 34, hgt);
131
+ color(mr{i}, cyan); opacity(mr{i}, 0.6); tag(mr{i}, minir);
132
+ }
133
+ // mini Lebesgue: a tiny layer cake
134
+ for j in 0..5 {
135
+ let wd = 200 - 34*j;
136
+ rect(ml{j}, (cx, myb - 9 - j*17), wd, 14);
137
+ color(ml{j}, gold); opacity(ml{j}, 0.6); tag(ml{j}, minil);
138
+ }
139
+ // mini Henstock-Kurzweil: coarse cells, then a burst of fine ones at the spike
140
+ for i in 0..3 {
141
+ rect(mw{i}, (mxh - 90 + i*42, myb - 19), 40, 38);
142
+ color(mw{i}, teal); opacity(mw{i}, 0.6); tag(mw{i}, minih);
143
+ }
144
+ for k in 0..5 {
145
+ let hgt = 38 + 52*exp(-0.7*((k - 2)^2));
146
+ rect(mn{k}, (mxh + 10 + (k + 0.5)*11, myb - hgt/2), 9, hgt);
147
+ color(mn{k}, magenta); opacity(mn{k}, 0.75); tag(mn{k}, minih);
148
+ }
149
+ rect(mt, (mxh + 88, myb - 19), 40, 38); color(mt, teal); opacity(mt, 0.6); tag(mt, minih);
150
+ hidden(minir); hidden(minil); hidden(minih);
151
+
152
+ caption(ms1, "slice the domain", (mxr, 560), 26, cyan); hidden(ms1);
153
+ caption(ms2, "slice the range", (cx, 560), 26, gold); hidden(ms2);
154
+ caption(ms3, "slice by a gauge", (mxh, 560), 26, magenta); hidden(ms3);
155
+
156
+ // ================= timeline =================
157
+
158
+ // ---- cold open: title types on, the three names POP word by word
159
+ type(head, 1.2);
160
+ stagger(0.5) { wordpop(in1, 0.05); wordpop(in2, 0.05); wordpop(in3, 0.05); }
161
+ wait(1.2);
162
+ par { fade(in1, 0.4); fade(in2, 0.4); fade(in3, 0.4); }
163
+
164
+ // ---- act 1: RIEMANN ----------------------------------------------------
165
+ cue(whoosh);
166
+ show(t1, 0.5);
167
+ par { draw(xax, 0.6); draw(yax, 0.6); show(xl0, 0.6); show(xl4, 0.6); }
168
+ show(rider, 0.2);
169
+ par { draw(fplot, 1.5); travel(rider, fplot, 1.5, smooth); }
170
+ fade(rider, 0.3);
171
+ say(cap, "Slice the domain into equal strips; each SAMPLE DOT sets its strip's height", 0.5);
172
+ stagger(0.08) { for i in 0..8 { par { show(rc{i}, 0.3); shift(rc{i}, (0, -26), 0.4, out); show(sm{i}, 0.3); } } }
173
+ show(eqR, 0.6);
174
+ wait(1.2);
175
+
176
+ // push IN while the strips refine, equation rewrites underneath
177
+ say(cap, "Refine: quadruple the strips - the staircase hugs the curve", 0.5);
178
+ par { cam((cx, gy - 1.2*sy), 1.1, smooth); zoom(1.45, 1.1, smooth); }
179
+ par { fade(coarse, 0.5); fade(samples, 0.5); stagger(0.02) { for i in 0..32 { show(rf{i}, 0.22); } } }
180
+ cue(tick);
181
+ rewrite(eqR, `S_{32} \;=\; \sum_{i=1}^{32} f(x_i^{*})\,\textcolor{cyan}{\Delta x}`, 0.8);
182
+ wait(0.9);
183
+ par { cam((cx, cy), 1.0, smooth); zoom(1, 1.0, smooth); }
184
+
185
+ // the limit: strips dissolve into the EXACT swept area, the number climbs
186
+ cue(tick);
187
+ rewrite(eqR, `\int_0^{4} f\,dx \;=\; \lim_{n\to\infty} S_n`, 0.9);
188
+ say(cap, "In the limit, the sum becomes the exact area", 0.5);
189
+ show(intg, 0.3);
190
+ par { fade(fine, 1.2); to(ar, x, 4, 2.2, smooth); to(intg, x, 4, 2.2, smooth); }
191
+ flash(intg, gold);
192
+ wait(1.0);
193
+ par { shift(wipe1, (w + 80, 0), 0.7, linear); fade(ar, 0.5); fade(intg, 0.5); disintegrate(eqR, 0.8); fade(t1, 0.5); }
194
+
195
+ // ---- act 2: LEBESGUE ---------------------------------------------------
196
+ cue(whoosh);
197
+ show(t2, 0.5);
198
+ say(cap, "Turn the slicing sideways: cut the range, not the domain", 0.5);
199
+ show(pv, 0.3);
200
+ par { rotate(pv, 90, 0.9, smooth); recolor(pv, gold, 0.9); }
201
+ fade(pv, 0.4);
202
+ show(eqL, 0.6);
203
+ show(lev, 0.3);
204
+ par {
205
+ stagger(0.1) { for j in 0..10 { par { show(ls{j}, 0.35); shift(ls{j}, (180*(j - 2*floor(j/2)) - 90, 0), 0.5, out); } } }
206
+ shift(lev, (0, -2.7*sy), 1.9, smooth);
207
+ zoom(1.06, 2.2, smooth);
208
+ }
209
+ // the stack breathes: a travelling wave rolls up through the layers
210
+ par { for j in 0..10 { oscillate(ls{j}, y, 2.4, 3, j/10, 3.2); } pulse(ls4, 0.9); }
211
+ say(cap, "A layer at height t sits over the set where f > t; its width is that set's measure", 0.5);
212
+ cue(tick);
213
+ rewrite(eqL, `\int f\,d\mu \;=\; \int_0^{\infty}\textcolor{gold}{\mu\{\,f > t\,\}}\,dt`, 0.9);
214
+ wait(1.2);
215
+ fade(lev, 0.4);
216
+ par { shift(wipe2, (w + 80, 0), 0.7, linear); fade(layers, 0.5); disintegrate(eqL, 0.8); fade(t2, 0.5); fade(fplot, 0.5); zoom(1, 0.8, smooth); }
217
+
218
+ // ---- act 3: HENSTOCK-KURZWEIL ------------------------------------------
219
+ cue(whoosh);
220
+ show(t3, 0.5);
221
+ show(rider2, 0.2);
222
+ par { draw(gplot, 1.4); travel(rider2, gplot, 1.4, smooth); }
223
+ fade(rider2, 0.3);
224
+ say(cap, "New function, old recipe: equal strips again...", 0.5);
225
+ stagger(0.07) { for i in 0..8 { par { show(hku{i}, 0.3); shift(hku{i}, (0, -26), 0.4, out); } } }
226
+ show(eqH, 0.6);
227
+ wait(0.5);
228
+
229
+ // push in on the spike: the uniform cells FAIL, flash red, shake, shatter
230
+ par { cam((gx + 3*sx, gy - 1.3*sy), 1.1, smooth); zoom(1.6, 1.1, smooth); }
231
+ say(cap, "The spike slips between samples - equal widths are too coarse here", 0.5);
232
+ par { recolor(hku5, red, 0.3); recolor(hku6, red, 0.3); shake(hku5, 0.8); shake(hku6, 0.8); }
233
+ cue(pop);
234
+ par { disintegrate(hku5, 0.8); disintegrate(hku6, 0.8); }
235
+
236
+ // the gauge appears AS A FUNCTION: it dips exactly where f is dangerous
237
+ say(cap, `The gauge $\delta(x)$ is itself a function - watch it dip where f spikes`, 0.5);
238
+ par { draw(dplot, 1.0); show(dlab, 0.6); }
239
+ say(cap, `Tiny slices where f is wild - and every slice carries its tag point $t_i$`, 0.5);
240
+ stagger(0.05) { for i in 0..10 { par { show(nk{i}, 0.22); show(tg{i}, 0.22); } } }
241
+ show(bnar, 0.5);
242
+ wait(0.8);
243
+ par { cam((cx, cy), 1.0, smooth); zoom(1, 1.0, smooth); }
244
+ cue(tick);
245
+ rewrite(eqH, `\Delta x_i < \textcolor{magenta}{\delta(t_i)} \;\Longrightarrow\; \Big|\sum_i f(t_i)\,\Delta x_i - A\Big| < \varepsilon`, 0.9);
246
+ flow(gplot, 1.5, forward, once);
247
+ wait(1.2);
248
+
249
+ // ---- finale: wipe to black, hierarchy + confetti + triptych reprise ------
250
+ par {
251
+ shift(wipe3, (w + 80, 0), 0.7, linear);
252
+ fade(hk, 0.5); fade(tgd, 0.5); fade(gplot, 0.5); fade(dplot, 0.5); fade(dlab, 0.5);
253
+ fade(xax, 0.5); fade(yax, 0.5); fade(xl0, 0.5); fade(xl4, 0.5);
254
+ disintegrate(eqH, 0.8); fade(bnar, 0.5); fade(t3, 0.5);
255
+ }
256
+ cue(chime);
257
+ show(eqS, 0.8);
258
+ par {
259
+ breathe(eqS, 3, 0.05, 0, 7);
260
+ seq { show(conf, 0.1); burst(conf, 1.4); }
261
+ seq {
262
+ stagger(0.35) {
263
+ stagger(0.05) { for i in 0..6 { show(mr{i}, 0.25); } }
264
+ stagger(0.06) { for j in 0..5 { show(ml{j}, 0.25); } }
265
+ seq { stagger(0.04) { for i in 0..3 { show(mw{i}, 0.2); } } stagger(0.04) { for k in 0..5 { show(mn{k}, 0.2); } } show(mt, 0.2); }
266
+ }
267
+ stagger(0.3) { wordpop(ms1, 0.06); wordpop(ms2, 0.06); wordpop(ms3, 0.06); }
268
+ }
269
+ }
270
+ say(cap, "One area - three philosophies of slicing", 0.6);
271
+ wait(2.5);
272
+
273
+ equation(equation, (548, 548), `\int_{a}^{b} f(x)\,dx`, 48);
274
+ color(equation, fg);
@@ -0,0 +1,94 @@
1
+ title("Inverse-function derivatives — why the pairs mirror");
2
+ canvas("16:9");
3
+
4
+ // uniform scale (sx == sy) so a function and its inverse reflect correctly
5
+ let ox = cx - 470;
6
+ let oy = cy + 110;
7
+ let s = 72;
8
+
9
+ text(hdr, (cx, 52), "A function and its inverse: mirror curves, reciprocal slopes");
10
+ size(hdr, 26); color(hdr, cyan); bold(hdr); display(hdr); hidden(hdr);
11
+
12
+ // ---------------- the mirror plane ----------------
13
+ axes(ax, (ox, oy), 470, 300, 1);
14
+ color(ax, dim); untraced(ax);
15
+
16
+ // y = x, the mirror line
17
+ line(diag, (ox - 2.6*s, oy + 2.6*s), (ox + 3.8*s, oy - 3.8*s));
18
+ color(diag, dim); untraced(diag);
19
+ text(diaglab, (ox + 3.4*s, oy - 3.4*s - 22), "y = x");
20
+ size(diaglab, 16); color(diaglab, dim); display(diaglab); hidden(diaglab);
21
+
22
+ // e^x and its inverse ln x — reflections of each other
23
+ plot(ef, (ox, oy), s, s, "exp(x)", (-2.6, 1.45));
24
+ color(ef, cyan); stroke(ef, 3); untraced(ef);
25
+ text(eflab, (ox + 1.45*s + 8, oy - 4.1*s), "e^x");
26
+ size(eflab, 18); color(eflab, cyan); display(eflab); hidden(eflab);
27
+
28
+ plot(lf, (ox, oy), s, s, "ln(x)", (0.075, 4.3));
29
+ color(lf, magenta); stroke(lf, 3); untraced(lf);
30
+ text(lflab, (ox + 4.2*s, oy - 1.45*s), "ln x");
31
+ size(lflab, 18); color(lflab, magenta); display(lflab); hidden(lflab);
32
+
33
+ // tangent + live slope at a point on e^x, and at its mirror point on ln x
34
+ tangent(te, ef, 0.5, 150);
35
+ color(te, cyan); hidden(te);
36
+ slope(se, ef, 0.5);
37
+ color(se, cyan); hidden(se);
38
+
39
+ tangent(tl, lf, 1.65, 150);
40
+ color(tl, magenta); hidden(tl);
41
+ slope(sl, lf, 1.65);
42
+ color(sl, magenta); hidden(sl);
43
+
44
+ text(rec, (cx + 340, cy + 60), "slope x slope = 1");
45
+ size(rec, 22); color(rec, lime); bold(rec); display(rec); hidden(rec);
46
+ text(rec2, (cx + 340, cy + 96), "(1.65) x (0.61)");
47
+ size(rec2, 18); color(rec2, dim); display(rec2); hidden(rec2);
48
+
49
+ // ---------------- the four identity pairs ----------------
50
+ text(t1, (cx + 340, cy - 190), "(e^x)' = e^x (ln x)' = 1/x");
51
+ size(t1, 17); color(t1, fg); display(t1); hidden(t1);
52
+ text(t2, (cx + 340, cy - 150), "(sin x)' = sqrt(1-sin^2 x) (arcsin x)' = 1/sqrt(1-x^2)");
53
+ size(t2, 15); color(t2, fg); display(t2); hidden(t2);
54
+ text(t3, (cx + 340, cy - 118), "(cos x)' = -sqrt(1-cos^2 x) (arccos x)' = -1/sqrt(1-x^2)");
55
+ size(t3, 15); color(t3, fg); display(t3); hidden(t3);
56
+ text(t4, (cx + 340, cy - 86), "(tan x)' = 1+tan^2 x (arctan x)' = 1/(1+x^2)");
57
+ size(t4, 15); color(t4, fg); display(t4); hidden(t4);
58
+
59
+ // ================= timeline =================
60
+ show(hdr, 0.6);
61
+ draw(ax, 0.7);
62
+ draw(diag, 0.5);
63
+ show(diaglab, 0.3);
64
+ par {
65
+ draw(ef, 1.4);
66
+ draw(lf, 1.4);
67
+ }
68
+ par {
69
+ show(eflab, 0.4);
70
+ show(lflab, 0.4);
71
+ }
72
+ wait(0.3);
73
+
74
+ // the reciprocal-slope check
75
+ par {
76
+ show(te, 0.4);
77
+ show(se, 0.4);
78
+ }
79
+ par {
80
+ show(tl, 0.4);
81
+ show(sl, 0.4);
82
+ }
83
+ show(rec, 0.5);
84
+ show(rec2, 0.4);
85
+ flash(rec, lime);
86
+ wait(0.4);
87
+
88
+ // the four pairs it generates
89
+ stagger(0.4) {
90
+ show(t1, 0.4);
91
+ show(t2, 0.4);
92
+ show(t3, 0.4);
93
+ show(t4, 0.4);
94
+ }