Find coordinates at the midpoint of a line.

조회 수: 6 (최근 30일)
Mark
Mark 2011년 11월 27일
답변: Ankit 2023년 1월 19일
I can plot a line between points (so I know the x and y's of the endpoints). I also know this can give the distance between the points. I'm sure there is a oneline command to calculate the midpoint coordinates. Any help would be appreciated. Thankyou.

채택된 답변

Walter Roberson
Walter Roberson 2011년 11월 27일
[(x1+x2)/2, (y1+y2)/2]

추가 답변 (1개)

Ankit
Ankit 2023년 1월 19일
line=[x1 y1;x2 y2]
line=[0 0;10 50];
mid_pt=mean(line)
mid_pt = 1×2
5 25

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by