How to do distance formula
1 回表示 (過去 30 日間)
古いコメントを表示
Im trying to find the distance between 2 points on a truss and I have the length and the x and y of the nodes on the truss but what code in matlab would make this work.
I know
d = sqtrt((x2-x1)^2+(y2-y1)^2) ;
But how would I apply it to an array on a truss
with x being the nodes and e being the edges or lines that connect nodes
X = [0 0
1 0
2 0
2 1
1 1
0 1
];
e = [1 2
2 3
3 4
4 5
5 6
6 1
2 4
3 5
1 5
2 6];
I just dont seem to get how to put these two together and make a distance formula that works. The lengths of these points are the outside lengths are 1 m and the cross section lengths are the sqrt of 2(these inside ones being from 1 to 5, 6 to 2, 4 to 2, and 5 to 3.
7 件のコメント
Rik
2022 年 3 月 28 日
If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks). That should help with tasks like this.
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Structural Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!