these vectors (A,B,C and D) achieved from balancing machine. (single plane) I put a mass (16.7 gram) at 219, 309, 39 and 129 degrees on balancing system and get A,B,C and D as a results. so it's means our balancing machine has a lag (or limp) as known "residual unbalance vector". and I trying to find the lag (or limp) vector that could be as corrective vector. I have four vectors and I'm trying to find corrective vector.
A = [16.54 219.7];
B = [16.82 309.8];
C = [16.86 40.3];
D = [16.74 128.9];
the corrective vector must to change those vectors (A,B,C,D) to these:
AR = [16.7 219.7];
BR = [16.7 309.7];
CR = [16.7 39.7];
DR = [16.7 129.7];
first number is magnitude and second number of each vectors is phase in degree. I changed this vectors to to coordinates (x,y) to find polygon and calculate the centroid of this polygon (my idea to find correction vector):
ax = A(1) * cosd(A(2));
ay = A(1) * sind(A(2));
bx = B(1) * cosd(B(2));
by = B(1) * sind(B(2));
cx = C(1) * cosd(C(2));
cy = C(1) * sind(C(2));
dx = D(1) * cosd(D(2));
dy = D(1) * sind(D(2));
u = [ax bx cx dx];
v = [ay by cy dy];
polyin = polyshape(u,v);
[A,B] = centroid(polyin);
after calculation, I subtracted each first vectors from A,B:
rax = ax-A;
ray = ay-B;
rbx = bx-A;
rby = by-B;
rcx = cx-A;
rcy = cy-B;
rdx = dx-A;
rdy = dy-B;
U = [rax rbx rcx rdx];
V = [ray rby rcy rdy];
at the end i calculated result vectors (change coordinates to vectors):
am = sqrt(rax * rax + ray * ray);
ap = rad2deg(atan2(ray,rax));
bm = sqrt(rbx * rbx + rby * rby);
bp = rad2deg(atan2(rby,rbx));
cm = sqrt(rcx * rcx + rcy * rcy);
cp = rad2deg(atan2(rcy,rcx));
dm = sqrt(rdx * rdx + rdy * rdy);
dp = rad2deg( atan2(rdy,rdx));
mag = [am bm cm dm]
phase = [ap bp cp dp]
but results are:
mag = 16.6878 16.8457 16.7120 16.7132
phase = 219.79 309.3 40.21 129.40
is there any idea to find best correction vector? thanks.