Files

40 lines
2.4 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 350" width="500" height="350">
<defs>
<marker id="fk-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<text x="250" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">2-Link Robot Arm: Forward Kinematics</text>
<!-- Base -->
<rect x="90" y="280" width="60" height="20" rx="3" fill="#555" stroke="#333" stroke-width="1.5"/>
<text x="120" y="315" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#555">base</text>
<!-- Joint 1 -->
<circle cx="120" cy="280" r="8" fill="#3498db" stroke="#2980b9" stroke-width="2"/>
<text x="100" y="273" text-anchor="end" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">q₁</text>
<!-- Link 1 -->
<line x1="120" y1="280" x2="260" y2="180" stroke="#333" stroke-width="5" stroke-linecap="round"/>
<text x="175" y="218" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#666" transform="rotate(-35, 175, 218)">link 1 (l₁)</text>
<!-- Joint 2 -->
<circle cx="260" cy="180" r="8" fill="#e74c3c" stroke="#c0392b" stroke-width="2"/>
<text x="240" y="172" text-anchor="end" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#e74c3c">q₂</text>
<!-- Link 2 -->
<line x1="260" y1="180" x2="370" y2="110" stroke="#333" stroke-width="4" stroke-linecap="round"/>
<text x="325" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#666" transform="rotate(-30, 325, 130)">link 2 (l₂)</text>
<!-- End effector -->
<circle cx="370" cy="110" r="6" fill="#27ae60" stroke="#1e8449" stroke-width="2"/>
<text x="390" y="105" text-anchor="start" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">end-effector</text>
<text x="390" y="120" text-anchor="start" font-family="Arial, sans-serif" font-size="10" fill="#27ae60">(x, y)</text>
<!-- Angle arcs -->
<path d="M 150,280 A 30,30 0 0,0 138,258" fill="none" stroke="#3498db" stroke-width="1.5"/>
<path d="M 283,197 A 25,25 0 0,0 279,178" fill="none" stroke="#e74c3c" stroke-width="1.5"/>
<!-- FK formula -->
<text x="250" y="345" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#333">FK: x = l₁cos(q₁) + l₂cos(q₁+q₂), y = l₁sin(q₁) + l₂sin(q₁+q₂)</text>
</svg>