|
250 | 250 | end
|
251 | 251 |
|
252 | 252 |
|
253 |
| -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
254 |
| -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
255 |
| -function [X1,X2,X3]=CoordTrans(x1,x2,x3,A1,A2,A3) |
256 |
| -% CoordTrans transforms the coordinates of the vectors, from |
257 |
| -% x1x2x3 coordinate system to X1X2X3 coordinate system. The transformation |
258 |
| -% whose columns A1, A2 and A3 are the unit base vectors of the x1x2x3. The |
259 |
| -% coordinates of e1,e2 and e3 in A must be given in X1X2X3. The transpose |
260 |
| -% of A (i.e., A') will transform the coordinates from X1X2X3 into x1x2x3. |
261 |
| - |
262 |
| -X1 = A1(:,1).*x1 + A1(:,2).*x2 + A1(:,3).*x3; |
263 |
| -X2 = A2(:,1).*x1 + A2(:,2).*x2 + A2(:,3).*x3; |
264 |
| -X3 = A3(:,1).*x1 + A3(:,2).*x2 + A3(:,3).*x3; |
265 |
| -end |
266 |
| - |
267 | 253 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
268 | 254 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
269 | 255 | function [ue,un,uv]=AngSetupFSC(X,Y,bX,bY,bZ,PA,PB,nu2)
|
|
272 | 258 |
|
273 | 259 | SideVec = PB-PA;
|
274 | 260 | beta = acos(-SideVec(:,3)./sqrt(sum(SideVec.^2,2)));
|
| 261 | +Vnorm = sqrt(sum(SideVec(:,1:2).^2,2)); |
275 | 262 |
|
276 |
| -ey1 = [SideVec(:,1:2),zeros(size(X))]; |
277 |
| -ey1 = ey1./repmat(sqrt(sum(ey1.^2,2)),1,3); |
278 |
| -ey3 = repmat([0 0 -1],length(X),1); |
279 |
| -%ey2 = cross(ey3,ey1,2); |
280 |
| -ey2 = [ey1(:,2),-ey1(:,1),zeros(size(X))]; |
| 263 | +A1 = SideVec(:,1)./Vnorm; |
| 264 | +A2 = SideVec(:,2)./Vnorm; |
281 | 265 |
|
282 | 266 | % Transform coordinates from EFCS to the first ADCS
|
283 |
| -[y1A,y2A,~] = CoordTrans(X-PA(:,1),Y-PA(:,2),-PA(:,3),ey1,ey2,ey3); |
| 267 | +y1A = A1.*(X - PA(:,1)) + A2.*(Y - PA(:,2)); |
| 268 | +y2A = A2.*(X - PA(:,1)) - A1.*(Y - PA(:,2)); |
| 269 | + |
284 | 270 | % Transform coordinates from EFCS to the second ADCS
|
285 |
| -[y1AB,y2AB,~] = CoordTrans(SideVec(:,1),SideVec(:,2),SideVec(:,3),ey1,ey2,ey3); |
286 |
| -y1B = y1A-y1AB; |
287 |
| -y2B = y2A-y2AB; |
| 271 | +y1B = y1A - (A1.*SideVec(:,1) + A2.*SideVec(:,2)); |
| 272 | +y2B = y2A - (A2.*SideVec(:,1) - A1.*SideVec(:,2)); |
288 | 273 |
|
289 | 274 | % Transform slip vector components from EFCS to ADCS
|
290 |
| -[b1,b2,b3] = CoordTrans(bX,bY,bZ,ey1,ey2,ey3); |
| 275 | +b1 = A1.*bX + A2.*bY; |
| 276 | +b2 = A2.*bX - A1.*bY; |
| 277 | +b3 = -bZ; |
291 | 278 |
|
292 | 279 | [v1A,v2A,v3A] = AngDisDispSurf(y1A,y2A,beta,b1,b2,b3,nu2,-PA(:,3));
|
293 | 280 | [v1B,v2B,v3B] = AngDisDispSurf(y1B,y2B,beta,b1,b2,b3,nu2,-PB(:,3));
|
|
305 | 292 | v3 = v3B - v3A;
|
306 | 293 |
|
307 | 294 | % Transform total displacements from ADCS to EFCS
|
308 |
| -ue = ey1(:,1).*v1 + ey2(:,1).*v2; |
309 |
| -un = ey1(:,2).*v1 + ey2(:,2).*v2; |
310 |
| -uv = ey3(:,3).*v3; |
| 295 | +ue = A1.*v1 + A2.*v2; |
| 296 | +un = A2.*v1 - A1.*v2; |
| 297 | +uv = -v3; |
311 | 298 |
|
312 | 299 | k = abs(beta)<eps | abs(pi-beta)<eps;
|
313 | 300 | ue(k) = 0;
|
|
0 commit comments