Find coordinates at the midpoint of a line.

32 vues (au cours des 30 derniers jours)
Mark
Mark le 27 Nov 2011
Réponse apportée : Ankit le 19 Jan 2023
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.

Réponse acceptée

Walter Roberson
Walter Roberson le 27 Nov 2011
[(x1+x2)/2, (y1+y2)/2]
  1 commentaire
Mark
Mark le 27 Nov 2011
Thank you very much.

Connectez-vous pour commenter.

Plus de réponses (1)

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

Catégories

En savoir plus sur 2-D and 3-D Plots 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!

Translated by