1
イムをプロット:ここillusratedのようにMATLABでほうきのような図を作成しようとしているほうき/光源
私の考えでは、水平線から始め、その後内回転行列を使用していましたループを作成します。しかし、私のコードは私の上でトリックを演奏しているようだ。
一言で言えば、私はそれぞれの行と行の間に同じ角度で特定の点から広がった線を作りたいと思います。
これは、これまでの私のコードです。
th = pi/12; % 15 degrees between every line
pointA = [20 50]; %The starting point of every line
pointB = [90 50]; %The ending point of the center line
v = [pointA(1) pointB(1); pointA(2) pointB(2)];
%
R [email protected](x)[cos(x) -sin(x); sin(x) cos(x)]; % Rotation matrix function
%
for i = -4:4
c = R(i*th)*v;
line([pointA(1) c(1,2)],[pointA(2) c(2,2)]);
hold on
end
ライン上の角度(中心線を除く)がオフになっている理由はありますか?
おかげで、@Wolfieを! –