2次元線形を3次元に​プロットする際、仰角​をつけてプロットした​いです。

5 views (last 30 days)
大智 山本
大智 山本 on 16 May 2024
Commented: 大智 山本 on 20 May 2024
以下に示す2次元線形を三次元にプロットし、仰角をつけて表示させたいです。
この場合、どのようにすれば平面の線形に仰角をつけられるでしょうか?
r2 = 30
r2 = 30
dot = (0:10:350);
[s,t] = meshgrid((dot/180)*pi, (dot/180)*pi)
s = 36x36
0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615 0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615 0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615 0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615 0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615 0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615 0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615 0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615 0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615 0 0.1745 0.3491 0.5236 0.6981 0.8727 1.0472 1.2217 1.3963 1.5708 1.7453 1.9199 2.0944 2.2689 2.4435 2.6180 2.7925 2.9671 3.1416 3.3161 3.4907 3.6652 3.8397 4.0143 4.1888 4.3633 4.5379 4.7124 4.8869 5.0615
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
t = 36x36
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.1745 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.3491 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.5236 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.6981 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 0.8727 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.0472 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.2217 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.3963 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708 1.5708
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
er2 = 3
er2 = 3
rr2 = r2 + sin(er2*(dot/180)*pi)
rr2 = 1x36
30.0000 30.5000 30.8660 31.0000 30.8660 30.5000 30.0000 29.5000 29.1340 29.0000 29.1340 29.5000 30.0000 30.5000 30.8660 31.0000 30.8660 30.5000 30.0000 29.5000 29.1340 29.0000 29.1340 29.5000 30.0000 30.5000 30.8660 31.0000 30.8660 30.5000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
xxr2 = rr2 .* cos((dot/180).*pi)
xxr2 = 1x36
30.0000 30.0366 29.0046 26.8468 23.6447 19.6050 15.0000 10.0896 5.0591 0.0000 -5.0591 -10.0896 -15.0000 -19.6050 -23.6447 -26.8468 -29.0046 -30.0366 -30.0000 -29.0518 -27.3770 -25.1147 -22.3179 -18.9622 -15.0000 -10.4316 -5.3598 -0.0000 5.3598 10.4316
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
yyr2 = rr2 .* sin((dot/180).*pi)
yyr2 = 1x36
0 5.2963 10.5568 15.5000 19.8403 23.3644 25.9808 27.7209 28.6914 29.0000 28.6914 27.7209 25.9808 23.3644 19.8403 15.5000 10.5568 5.2963 0.0000 -5.1226 -9.9644 -14.5000 -18.7270 -22.5983 -25.9808 -28.6606 -30.3971 -31.0000 -30.3971 -28.6606
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
plot(xxr2,yyr2)

Accepted Answer

Atsushi Ueno
Atsushi Ueno on 16 May 2024
Z軸を作ってplot3関数で3次元平面にプロットすれば、平面の線形に仰角をつけられます。
下記はY座標をZ座標に転記しただけですが、仰角と距離からZ座標を計算すれば狙い通りになるでしょう。
dot = (0:10:350) / 180 * pi;
xxr2 = (30 + sin(3*dot)) .* cos(dot);
yyr2 = (30 + sin(3*dot)) .* sin(dot);
plot3(xxr2,yyr2,yyr2);
view(45,45);
  4 Comments
交感神経優位なあかべぇ
回転は、hgtransformを使用すると比較的簡単に表現できます。
dot = (0:10:350) / 180 * pi;
xxr2 = (30 + sin(3*dot)) .* cos(dot);
yyr2 = (30 + sin(3*dot)) .* sin(dot);
figure; view(3); hold on; grid on;
axis([-40 40 -40 40 -40 40]);
f = hgtransform('Matrix', makehgtform('yrotate', deg2rad(20))); %y軸を基準に20°回転
plot(f,xxr2,yyr2);
大智 山本
大智 山本 on 20 May 2024
回答ありがとうございました!
参考にさせていただきます!!

Sign in to comment.

More Answers (0)

Categories

Find more on ビッグ データの処理 in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!