How to do distance formula

조회 수: 1 (최근 30일)
Kaden Bauernfeind
Kaden Bauernfeind 2022년 3월 28일
댓글: VBBV 2022년 3월 28일
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.

답변 (1개)

KSSV
KSSV 2022년 3월 28일
If(x1,y1) and (X2,y2) are two points. To get the distance use the formula:
d = sqtrt((x2-x1)^2+(y2-y1)^2) ;
  댓글 수: 3
KSSV
KSSV 2022년 3월 28일
d = sqrt((x(:,2)-x(:,1)).^2+(y(:,2)-y(:,1)).^2) ;
VBBV
VBBV 2022년 3월 28일
+1

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Structural Analysis에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by