CodeCodeCode

ENGR132: HW03 - line_length

Mar 30th, 2011
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.17 KB | None | 0 0
  1. function length = line_length(x_1, y_1, x_2, y_2)
  2.  
  3. % Calculates the distance between the two points (x_1, y_1) and (x_2, y_2).
  4. length = sqrt((x_2 - x_1)^2 + (y_2 - y_1)^2);
Advertisement
Add Comment
Please, Sign In to add comment