3次元で円錐台を描く方法
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
下記に示すようなプログラムを書きました。矢印ではなく、「円錐台を反転させた立体図」で書くにはどのように修正をしたらいいですか?
p1 = [0 0 0]; % 始点
p2 = [0 0 1]; % 終点
quiver3(p1(1), p1(2), p1(3), p2(1)-p1(1), p2(2)-p1(2), p2(3)-p1(3), 0)
hold on
sita=deg2rad(45);
p1 = [0 0 0]; % 始点
p2 = [0 -sin(sita) cos(sita)]; % 終点
quiver3(p1(1), p1(2), p1(3), p2(1)-p1(1), p2(2)-p1(2), p2(3)-p1(3), 0)
p1 = [0 0 0]; % 始点
p2 = [sin(sita) 0 cos(sita)]; % 終点
quiver3(p1(1), p1(2), p1(3), p2(1)-p1(1), p2(2)-p1(2), p2(3)-p1(3), 0)
p1 = [0 0 0]; % 始点
p2 = [0 sin(sita) cos(sita)]; % 終点
quiver3(p1(1), p1(2), p1(3), p2(1)-p1(1), p2(2)-p1(2), p2(3)-p1(3), 0)
p1 = [0 0 0]; % 始点
p2 = [-sin(sita) 0 cos(sita)]; % 終点
quiver3(p1(1), p1(2), p1(3), p2(1)-p1(1), p2(2)-p1(2), p2(3)-p1(3), 0)
0 commentaires
Réponse acceptée
Naoya
le 4 Juil 2018
円柱座標を作成する関数として cylinder があります。
こちらは半径と円周を解像度を引数として指定します。 円錐の場合、半径の値を 0 から徐々に増加させるにすると円錐座標を求められます。 円錐台ということでz方向にバイアスを付けた円柱を重ね書きするとよいと思います。
% 円錐を作成
[X,Y,Z] = cylinder([0:0.1:1],50);
Z = Z/sqrt(2);
% 円柱を作成
[X2,Y2,Z2] = cylinder([1 1],50);
Z2 = (1-1/sqrt(2))*Z2+ 1/sqrt(2);
% グラフ描画
surf(X,Y,Z)
hold on
surf(X2,Y2,Z2)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur ベクトル場 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!