2-Link Inverse Kinematics Calculator

Input target (x, y) coordinates, solve for two joint angles θ₁, θ₂ and determine whether the target is within the reachable workspace, for robot-arm path planning.

📐 计算公式
二连杆逆运动学(本页代码口径):c₂ = (x²+y²−L₁²−L₂²)÷(2×L₁×L₂);可达时先取 θ₂A = +arccos(c₂)、θ₁A = atan2(y,x) − atan2(L₂ sinθ₂A, L₁+L₂ cosθ₂A),再取 θ₂B = −θ₂A、θ₁B = atan2(y,x) − atan2(L₂ sinθ₂B, L₁+L₂ cosθ₂B),成对输出肘下/肘上两组解并转°。校验:L₁、L₂ 必须 > 0;两组解分别用正运动学回代 (L₁cosθ₁+L₂cos(θ₁+θ₂), L₁sinθ₁+L₂sin(θ₁+θ₂)) 检查残差;c₂ ∉ [−1,1] 即不可达(可达环带 |L₁−L₂| ≤ r ≤ L₁+L₂)。θ₂≈0° 或 ±180° 时两解重合。

平面二连杆逆解,含可达性判定。

📌 计算说明
  • cosθ₂=(r²−L₁²−L₂²)/(2L₁L₂),θ₂ = ±arccos(c₂) 对应肘下/肘上两组解。
  • 两组 θ₁ 必须与各自 θ₂ 配对,不能把一组 θ₁ 和另一组 θ₂ 混搭。
  • |L₁−L₂| ≤ √(x²+y²) ≤ L₁+L₂ 才可解。