{"job_id":"anim-job-829442a8-36a5-4313-8329-944336504048","request_id":"bulk-2026-05-21T09-46-48-791Z-1-a1-physics.08.motion.distance-vs-displacement","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-829442a8-36a5-4313-8329-944336504048/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-829442a8-36a5-4313-8329-944336504048/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-829442a8-36a5-4313-8329-944336504048/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-829442a8-36a5-4313-8329-944336504048/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-829442a8-36a5-4313-8329-944336504048/scene-source.json","duration_seconds":15,"byte_size":471540,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-829442a8-36a5-4313-8329-944336504048","control_count":2,"interactivity":"none","simulation_id":"physics.08.motion.distance_vs_displacement","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-829442a8-36a5-4313-8329-944336504048","request":{"gap":{"topic":"motion-distance_vs_displacement","severity":"moderate","error_type":"concept_misunderstanding","memory_state":"fragile","display_topic":"Distance vs Displacement","common_wrong_answer":"The concept works the same way in all conditions.","confidence_at_error":"high","correct_understanding":"The concept depends on constraints, assumptions, and variable relationships."},"target":{"style":"auto","render":{"fps":30,"format":"mp4","resolution":"1920x1080","include_thumbnail":true,"include_transcript":true},"audience":{"tone":"neutral_instructional","grade":"8","language":"en"},"interactivity":"none","duration_seconds":15},"context":{"chapter":{"name":"Motion","ncert_class":8},"sub_topics":[{"topic":"motion-distance_vs_displacement","key_concepts":["Distance vs Displacement","Motion"]}]},"metadata":{"priority":"normal","trace_id":"bulk-run-2026-05-21T09-46-48-791Z"},"exam_type":"neet","asset_type":"simulation","request_id":"bulk-2026-05-21T09-46-48-791Z-1-a1-physics.08.motion.distance-vs-displacement","subject_area":"physics"},"renderer":"html_three_js_local","storyboard":{"beats":[{"label":"Topic","visual":"Show the topic title and the key physical context.","narration":"Distance vs Displacement"},{"label":"Mistake","visual":"Show the wrong approach and why it seems plausible.","narration":"The concept works the same way in all conditions."},{"label":"Correction","visual":"Show the right approach step by step.","narration":"The concept depends on constraints, assumptions, and variable relationships."},{"label":"Concept","visual":"Highlight the key formula and the governing relationship.","narration":"Distance vs Displacement. Motion"}],"title":"Distance vs Displacement","sceneCode":"<!doctype html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n  <title>Distance vs Displacement</title>\n  <style>\n    :root{--bg:#eef2f5;--panel:#ffffff;--line:#cfd8e3;--accent:#3b82f6;--text:#2f3b4a;--muted:#6b7a90;--blue:#3b82f6;--green:#159947;--red:#e76f51;}\n    *{box-sizing:border-box;}\n    body{margin:0;font-family:\"Plus Jakarta Sans\",\"Manrope\",\"Inter\",ui-sans-serif,system-ui,sans-serif;background:var(--bg);color:var(--text);}\n    main{min-height:100vh;display:grid;grid-template-columns:minmax(300px,380px) 1fr;}\n    aside{border-right:1px solid var(--line);background:var(--panel);padding:24px;overflow:auto;}\n    section{padding:24px;display:grid;place-items:center;}\n    h1{margin:0 0 10px;font-size:1.65rem;line-height:1.15;}\n    .sub{margin:0 0 16px;color:var(--muted);}\n    .formula{margin:0 0 14px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#f7f9fc;color:#243447;font-family:ui-monospace,monospace;font-size:0.9rem;}\n    .control{display:grid;gap:6px;margin:12px 0;}\n    .control input{width:100%;accent-color:var(--accent);}\n    ul{margin:14px 0 0 18px;padding:0;color:var(--muted);display:grid;gap:6px;}\n    li{list-style:none;margin:0 -18px;padding:8px 18px;border-radius:6px;}\n    li.misconception{background:#fff5f3;border-left:3px solid var(--red);}\n    li.key{background:#f0f7f4;border-left:3px solid var(--green);}\n    .stage{width:min(1020px,95%);aspect-ratio:16/9;border:1px solid var(--line);border-radius:14px;position:relative;overflow:hidden;background:#f6f8fb;box-shadow:0 6px 20px rgba(20,33,61,.08);}\n    .legend{position:absolute;right:12px;top:12px;padding:8px 10px;border-radius:10px;border:1px solid var(--line);background:#ffffff;font-size:0.8rem;color:var(--muted);max-width:240px;text-align:right;}\n    @media(max-width:900px){main{grid-template-columns:1fr;}aside{border-right:0;border-bottom:1px solid var(--line);}}\n  </style>\n</head>\n<body>\n<main>\n  <aside>\n    <h1>Distance vs Displacement</h1>\n    <p class=\"sub\">Why they're NOT the same</p>\n    <p class=\"formula\">Distance = total path length<br/>Displacement = Δx = x_f − x_i</p>\n    <label class=\"control\"><span>Path Type: <strong id=\"v-path\">Straight</strong></span><input id=\"c-path\" type=\"range\" min=\"0\" max=\"2\" step=\"1\" value=\"0\"/></label>\n    <label class=\"control\"><span>Speed: <strong id=\"v-speed\">1.0</strong> m/s</span><input id=\"c-speed\" type=\"range\" min=\"0.5\" max=\"2\" step=\"0.1\" value=\"1.0\"/></label>\n    <ul>\n      <li class=\"misconception\">❌ <strong>Mistake:</strong> Distance and displacement are always equal.</li>\n      <li class=\"key\">✓ <strong>Correction:</strong> Distance is scalar (path length). Displacement is vector (change in position).</li>\n      <li class=\"key\">💡 <strong>Key:</strong> Only equal when motion is straight, one direction.</li>\n    </ul>\n  </aside>\n  <section>\n    <div class=\"stage\" id=\"stage\">\n      <div class=\"legend\" id=\"legend\">t=0s | d=0m | Δx=0m</div>\n      <canvas id=\"sim-cv\" style=\"position:absolute;inset:0;width:100%;height:100%;\"></canvas>\n    </div>\n  </section>\n</main>\n<script>\nconst controls = [\n  {\"key\":\"path\",\"label\":\"Path Type\",\"min\":0,\"max\":2,\"step\":1,\"value\":0,\"units\":\"\"},\n  {\"key\":\"speed\",\"label\":\"Speed\",\"min\":0.5,\"max\":2,\"step\":0.1,\"value\":1.0,\"units\":\"m/s\"}\n];\nfor(const c of controls){\n  const inp=document.getElementById('c-'+c.key);\n  const out=document.getElementById('v-'+c.key);\n  inp?.addEventListener('input',()=>{\n    if(c.key==='path'){\n      const paths=['Straight','Circle','Back & Forth'];\n      out.textContent=paths[parseInt(inp.value)];\n    }else{\n      out.textContent=inp.value;\n    }\n    window.updateModel?.();\n  });\n}\n(function(){\n  const cv=document.getElementById('sim-cv');\n  const ctx=cv.getContext('2d');\n  function resize(){const r=cv.getBoundingClientRect();if(r.width>0){cv.width=r.width;cv.height=r.height;}}\n  resize();new ResizeObserver(resize).observe(cv);\n  let lastTs=0;\n  \n  // State variables\n  let t=0;\n  let pathType=0;\n  let speed=1.0;\n  let totalDistance=0;\n  let posHistory=[];\n  let distanceHistory=[];\n  \n  function getPosition(time,path){\n    const scaler=80;\n    switch(path){\n      case 0: // Straight line\n        return {x:time*speed*scaler,y:0,vx:speed*scaler,vy:0};\n      case 1: // Circle\n        const angle=time*speed;\n        const r=60;\n        return {x:r*Math.cos(angle),y:r*Math.sin(angle),vx:-r*Math.sin(angle)*speed,vy:r*Math.cos(angle)*speed};\n      case 2: // Back and forth (harmonic)\n        const amp=100;\n        const freq=speed*0.8;\n        return {x:amp*Math.sin(time*freq),y:0,vx:amp*Math.cos(time*freq)*freq,vy:0};\n      default:\n        return {x:0,y:0,vx:0,vy:0};\n    }\n  }\n  \n  function arrow(x1,y1,x2,y2,color,width){\n    const dx=x2-x1,dy=y2-y1,l=Math.sqrt(dx*dx+dy*dy);\n    if(l<2)return;\n    const nx=dx/l,ny=dy/l,s=12;\n    ctx.strokeStyle=color;ctx.lineWidth=width||2;\n    ctx.beginPath();ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.stroke();\n    ctx.fillStyle=color;ctx.beginPath();\n    ctx.moveTo(x2,y2);\n    ctx.lineTo(x2-s*nx+s*0.4*ny,y2-s*ny-s*0.4*nx);\n    ctx.lineTo(x2-s*nx-s*0.4*ny,y2-s*ny+s*0.4*nx);\n    ctx.fill();\n  }\n  \n  function glowDot(x,y,r,color,alpha){\n    const g=ctx.createRadialGradient(x,y,0,x,y,r*2.5);\n    g.addColorStop(0,color+'88');\n    g.addColorStop(1,color+'00');\n    ctx.fillStyle=g;\n    ctx.beginPath();ctx.arc(x,y,r*2.5,0,Math.PI*2);ctx.fill();\n  }\n  \n  function tick(ts){\n    const dt=Math.min(0.04,(ts-lastTs)/1000);lastTs=ts;\n    const W=cv.width,H=cv.height;\n    const CX=W*0.35,CY=H*0.5;\n    \n    pathType=parseInt(document.getElementById('c-path').value);\n    speed=parseFloat(document.getElementById('c-speed').value);\n    \n    // Update physics\n    t+=dt;\n    const pos=getPosition(t,pathType);\n    \n    // Accumulate distance traveled\n    if(posHistory.length>0){\n      const lastPos=posHistory[posHistory.length-1];\n      const dx=pos.x-lastPos.x;\n      const dy=pos.y-lastPos.y;\n      totalDistance+=Math.sqrt(dx*dx+dy*dy);\n    }\n    posHistory.push({x:pos.x,y:pos.y});\n    distanceHistory.push(totalDistance);\n    if(posHistory.length>150)posHistory.shift();\n    if(distanceHistory.length>150)distanceHistory.shift();\n    \n    // Calculate displacement (straight line from start to current)\n    const startX=getPosition(0,pathType).x;\n    const displacement=Math.abs(pos.x-startX);\n    \n    // Draw\n    ctx.clearRect(0,0,W,H);\n    \n    // Background grid\n    ctx.strokeStyle='#e5e9f0';\n    ctx.lineWidth=1;\n    for(let i=0;i<W;i+=40){\n      ctx.beginPath();ctx.moveTo(i,CY-80);ctx.lineTo(i,CY+80);ctx.stroke();\n    }\n    \n    // Origin marker\n    ctx.fillStyle='#9ca3af';\n    ctx.beginPath();ctx.arc(CX,CY,6,0,Math.PI*2);ctx.fill();\n    ctx.fillStyle='#6b7a90';\n    ctx.font='bold '+Math.round(H*0.032)+'px sans-serif';\n    ctx.textAlign='right';ctx.fillText('Start',CX-12,CY-16);\n    \n    // Draw path trajectory\n    if(pathType===1){\n      // Draw circle guide\n      ctx.strokeStyle='#d1d5db';ctx.lineWidth=1;ctx.setLineDash([4,4]);\n      ctx.beginPath();ctx.arc(CX,CY,60,0,Math.PI*2);ctx.stroke();\n      ctx.setLineDash([]);\n    }else if(pathType===2){\n      // Draw harmonic bounds\n      ctx.strokeStyle='#d1d5db';ctx.lineWidth=1;ctx.setLineDash([4,4]);\n      ctx.beginPath();ctx.moveTo(CX-100,CY);ctx.lineTo(CX+100,CY);ctx.stroke();\n      ctx.setLineDash([]);\n    }\n    \n    // Draw path history (faint trail)\n    if(posHistory.length>1){\n      ctx.strokeStyle='rgba(59,130,246,0.2)';\n      ctx.lineWidth=2;\n      ctx.beginPath();ctx.moveTo(CX+posHistory[0].x,CY+posHistory[0].y);\n      for(let i=1;i<posHistory.length;i++){\n        ctx.lineTo(CX+posHistory[i].x,CY+posHistory[i].y);\n      }\n      ctx.stroke();\n    }\n    \n    // Current position\n    ctx.fillStyle='#3b82f6';\n    ctx.beginPath();ctx.arc(CX+pos.x,CY+pos.y,8,0,Math.PI*2);ctx.fill();\n    glowDot(CX+pos.x,CY+pos.y,8,'#3b82f6',0.4);\n    \n    // Velocity vector (direction of motion)\n    const vScale=20;\n    arrow(CX+pos.x,CY+pos.y,CX+pos.x+pos.vx*vScale,CY+pos.y+pos.vy*vScale,'#159947',2.5);\n    \n    // Displacement vector (straight line from start to current)\n    const endX=CX+pos.x;\n    const endY=CY;\n    ctx.strokeStyle='#e76f51';ctx.lineWidth=2.5;ctx.setLineDash([6,4]);\n    ctx.beginPath();ctx.moveTo(CX,CY);ctx.lineTo(endX,endY);ctx.stroke();\n    ctx.setLineDash([]);\n    \n    // Displacement arrow label\n    ctx.fillStyle='#e76f51';\n    ctx.font='bold '+Math.round(H*0.032)+'px sans-serif';\n    ctx.textAlign='center';\n    ctx.fillText('Displacement',CX+pos.x/2,CY-20);\n    \n    // Info box: distance, displacement, time\n    const infoH=H*0.22;\n    const infoX=W*0.65;\n    const infoY=H*0.08;\n    ctx.fillStyle='rgba(243,244,246,0.85)';\n    ctx.fillRect(infoX,infoY,W*0.32,infoH);\n    ctx.strokeStyle='#d1d5db';ctx.lineWidth=1;\n    ctx.strokeRect(infoX,infoY,W*0.32,infoH);\n    \n    ctx.fillStyle='#243447';\n    ctx.font='bold '+Math.round(H*0.04)+'px sans-serif';\n    ctx.textAlign='left';\n    ctx.fillText('Measurements',infoX+12,infoY+28);\n    \n    ctx.fillStyle='#3b82f6';\n    ctx.font=Math.round(H*0.032)+'px sans-serif';\n    ctx.fillText('Distance (d): '+totalDistance.toFixed(1)+' m',infoX+12,infoY+52);\n    \n    ctx.fillStyle='#e76f51';\n    ctx.fillText('Displacement (Δx): '+displacement.toFixed(1)+' m',infoX+12,infoY+72);\n    \n    ctx.fillStyle='#6b7a90';\n    ctx.fillText('Time: '+t.toFixed(1)+' s',infoX+12,infoY+92);\n    \n    // Conceptual annotation\n    if(pathType===0){\n      ctx.fillStyle='#159947';\n      ctx.font='bold '+Math.round(H*0.036)+'px sans-serif';\n      ctx.textAlign='center';\n      ctx.fillText('✓ EQUAL: d = Δx (straight line)',W/2,H-28);\n    }else if(pathType===1){\n      ctx.fillStyle='#e76f51';\n      ctx.font='bold '+Math.round(H*0.036)+'px sans-serif';\n      ctx.textAlign='center';\n      ctx.fillText('✗ DIFFERENT: d > Δx (curved path)',W/2,H-28);\n    }else if(pathType===2){\n      ctx.fillStyle='#e76f51';\n      ctx.font='bold '+Math.round(H*0.036)+'px sans-serif';\n      ctx.textAlign='center';\n      ctx.fillText('✗ DIFFERENT: d > Δx (back & forth)',W/2,H-28);\n    }\n    \n    document.getElementById('legend').textContent='t=","remediationGoal":"Close concept_misunderstanding for physics."},"rendererStyle":"three_js"},"simulation_title":"Distance vs Displacement"}},"metadata":{"rendered_at":"2026-05-21T09:50:57.626Z","cache_hit":false,"cost_usd":0},"error":null}