MATLAB: System 3 eq with 3 unknown w. cos&sin

3 equations3 unknownscoserrorsinsolvesymbolicSymbolic Math Toolboxtoolbox

syms x y r
eq1=((1+cos(2))*x)+((1-cos(2))*y)+((sin(2))*r)==-741.6
eq2=((1+cos(140))*x)+((1-cos(140))*y)+((sin(140))*r)==1768.2
eq3=((1+cos(260))*x)+((1-cos(260))*y)+((sin(260))*r)==-2643.4
result=solve(eq1,eq2,eq3)
vpa(result.x)
vpa(result.y)
vpa(result.r)
what am i doing wrong?
aren't i supposed to get x=-414.722, y=143.579, r=2507.3

Best Answer

Yes, you are supposed to get that answer. However, you are using sin(), and cos(). In MATLAB, their input is assumed to be in radians. However, it appears that you consider them in degrees. Use sind() and cosd() instead
syms x y r
eq1=((1+cosd(2))*x)+((1-cosd(2))*y)+((sind(2))*r)==-741.6;
eq2=((1+cosd(140))*x)+((1-cosd(140))*y)+((sind(140))*r)==1768.2;
eq3=((1+cosd(260))*x)+((1-cosd(260))*y)+((sind(260))*r)==-2643.4;
result=solve(eq1,eq2,eq3)
vpa(result.x)
vpa(result.y)
vpa(result.r)
Result
ans =
-414.7217490391970254146602927994
ans =
143.57914066956583213246887681175
ans =
2507.2967959133361833043861853089