I am trying to solve a system of three equations with three unknown variables.
A1=((x+y)/2)+((x-y)/2*cos(2*phi))+(z*sin(2*phi))/2
A2=(x+y)/2-((x-y)/2)*cos(2*phi)-(z*sin(2*phi))/2
A3/2=(-(x-y)/2)*sin(2*phi)+(z*cos(2*phi))/2
where A1, A2, A3, and phi are known and x,y, and z are unknown. I got the result but its not correct because when I checked with isequal
it give me 0
This is the code
clear;
clc;
A1=50;
A2=37.5;
A3=125.6;
phi=-17.9;
syms x y z
eqn1 = (x+y)/2+(((x-y)/2)*cosd(2*phi))+(z*sind(2*phi))/2== A1;
eqn2 = (x+y)/2+(((x-y)/2)*cosd(2*phi))-(z*sind(2*phi))/2== A2;
eqn3 = ((-(x-y))/2*sind(2*phi))+((z/2)*cosd(2*phi))== A3/2;
[X, Y, Z] = solve(eqn1, eqn2, eqn3);
X = double(X);
Y = double(Y);
Z = double(Z);
AB=(X+Y)/2+(((X-Y)/2)*cosd(2*phi))+(Z*sind(2*phi))/2;
AC=(X+Y)/2+(((X-Y)/2)*cosd(2*phi))-(Z*sind(2*phi))/2;
AD=((-(X-Y)/2)*sind(2*phi))+((Z/2)*cosd(2*phi));
Z1=isequal(AB,A1);
Z2=isequal(AC,A2);
Z3=isequal(AD,A3/2);