I want to solve the make a module for the inverse kinematics of a 3R Spatial Manipulator. I am new to Mathematica and cant seem to figure out how to write it. The forward kinematics equations are :
x=cos(a1)*(l2cos(a2)+l3cos(a23))
y=sin(a1)(l2cos(a2)+l3cos(a23))
z=l1+l2sin(a2)+l3sin(a23)
a1,a2,a3 are the angles. l1,l2,l3 are the link lengths a23=a2+a3.. Can anyone please help I would like to avoid using the solve function.
forwardKinematics3R[l1_, l2_, l3_, {θ1_, θ2_, θ3_}, {x_, y_, z_}] := Module[
{sol}
, sol = {
x -> Cos[θ1]*(l2*Cos[θ2] + l3*Cos[θ2 + θ3])
, y -> Sin[θ1]*(l2*Cos[θ2] + l3*Cos[θ2 + θ3])
, z -> l1 + l2*Sin[θ2] + l3*Sin[θ2 + θ3]
}
; Return[sol];
];