내가 원의 밀집 계층을 생성하기 위해 점을 상자처럼 내 중심점을 생성하여 가까운 포장 레이어를 만든 다음 전단하려고 해요의 밀집 레이어를 만들 more info can be found herematlab에 .. 원
하지만 몇 가지 어려움을 겪고있어 .. 내 코드는 지금까지입니다
%% Trying out the shear function
rad=2; n=3;
[X,Y] = meshgrid(0 : rad*2 : rad*(n-1)*2 , ...
0 : sqrt(2*(2*rad)^2)/2 : sqrt(2*(2*rad)^2)/2*(n-1));
xyBox = [reshape(X,1,numel(X)) ; reshape(Y,1,numel(Y))];
Sh = @(m) [1 m; 0 1]; % horizontal shear - slope is qual to 1/m
slope = sqrt(3);
shearedCoordinates = Sh(1/slope) * xyBox;
figure; plot(xyBox(1,:),xyBox(2,:),'k.');
for i= 1:(numel(shearedCoordinates)/2)
hold on;
circle(shearedCoordinates(1,i),shearedCoordinates(2,i),rad)
plot(shearedCoordinates(1,i),shearedCoordinates(2,i),'bx')
hold off;
end
axis equal
정말 쉿 뒤에 수학을 이해하지 마십시오,하지만이 빌어 먹을 좋은 일을 볼 단지 수 twisti (전단) 점.
원 기능이
function circle(x,y,r)
angle=0:0.01:2*pi;
xp=r*cos(angle);
yp=r*sin(angle);
plot(x+xp,y+yp,'r');
end
* 해결 방법 *
입니다 ... 나는 적당한 장소를 제공해야 제곱근 3의 기울기를 계산하지만, 내 Y 거리에 문제가 뢰 디게 보인다%% Trying out the shear function
rad=2; n=3;
[X,Y] = meshgrid(0 : rad*2 : rad*(n-1)*2 , ...
0 : sqrt(3)*rad : sqrt(3)*rad*(n-1));
xyBox = [reshape(X,1,numel(X)) ; reshape(Y,1,numel(Y))];
Sh = @(m) [1 m; 0 1]; % horizontal shear - slope is qual to 1/m
slope = sqrt(3);
shearedCoordinates = Sh(1/slope) * xyBox;
figure; plot(xyBox(1,:),xyBox(2,:),'k.');
for i= 1:(numel(shearedCoordinates)/2)
hold on;
circle(shearedCoordinates(1,i),shearedCoordinates(2,i),rad)
plot(shearedCoordinates(1,i),shearedCoordinates(2,i),'bx')
hold off;
end
axis equal
높이가 틀린 것이 맞습니다. 그것은 sqrt (3) * rad이어야합니다. 어제 너무 많은 숫자를보고있었습니다. – Norfeldt
방금 최종 해결책을 추가했습니다 – Norfeldt
측 정삼각형의 고도가'a * sqrt (3)/2'이 아니라는 것을 여러분의 의견에 남겨 두었습니다.'a * sqrt (3)' . –