system 3 eq with 3 unknown w. cos&sin

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

1 Comment

I got this result
ans =
17200.42119561459346581104722787
ans =
1229.4313261175983169768030796407
ans =
-13774.564011183238331971257084028
Is it wrong?

Sign in to comment.

 Accepted 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

More Answers (0)

Products

Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!