HW3 #1 - y2 = input('Enter the y-coordinate of the second...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 %Engineering 6, Spring 2004, Problem 3.1 %Ryan Uy, 2509 %Section B05, Tues. 3-4 %Get user input for each coordinate x1 = input('Enter the x-coordinate of the first point\n') y1 = input('Enter the y-coordinate of the first point\n') x2 = input('Enter the x-coordinate of the second point\n')
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: y2 = input('Enter the y-coordinate of the second point\n') %Calculate distance (d) d = sqrt( (x1-x2)^2 + (y1-y2)^2 ) %Display distance fprintf('The distance between the two points is %.3f',d)...
View Full Document

This note was uploaded on 01/22/2011 for the course ENG 006 taught by Professor Lagerstrom during the Spring '06 term at UC Davis.

Ask a homework question - tutors are online