3D comet plot of multiple objects

バージョン 1.2.0.0 (3.12 KB) 作成者: CY Y
Plots trajectories of multiple objects in 3D with controllable speed and tail length
ダウンロード: 841
更新 2016/10/4

comet3n plots trajectories of multiple objects in 3D with controllable speed and tail length. It takes an M*5 array as an input. Column 1-4 is the (x,y,z,t) coordinate of an object, respectively. Column 5 is object id number. Time and object id number must both be integers. See example below or just run democomet3n.m
% Object 1
t = (1:500)*pi/50;
x = 16*(sin(t).^3);
y = 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t);
t = 1:500;
z = 0.5 * t;
id = ones(length(t), 1);
obj1 = cat(2, x', y', z', t', id);

% Object 2
t = (1:500)*pi/50;
x = -16*(sin(t).^3);
y = 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t);
t = 1:500;
z = -0.5 * t;
id = ones(length(t), 1)*2;
obj2 = cat(2, x', y', z', t', id);

% Combine two objects.
src = cat(1, obj1, obj2);

comet3n(src, 'speed', 5, 'headsize', 1.5, 'tailwidth', 2,...
'taillength', 100 )

引用

CY Y (2024). 3D comet plot of multiple objects (https://github.com/joe-of-all-trades/comet3n), GitHub. 取得済み .

MATLAB リリースの互換性
作成: R2016b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersObject Containers についてさらに検索
タグ タグを追加
謝辞

ヒントを得たファイル: 3D Comet Plot

Community Treasure Hunt

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

Start Hunting!

GitHub の既定のブランチを使用するバージョンはダウンロードできません

バージョン 公開済み リリース ノート
1.2.0.0

Added demo
Updated description to include example.
updated description

1.1.0.0

Corrected minor error in code
linked to github
faster rendering

1.0.0.0

この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。
この GitHub アドオンでの問題を表示または報告するには、GitHub リポジトリにアクセスしてください。