HW3 #3 - dsand = 3.25 ./ cos(radians) dtrail = 9 - 3.25 .*...

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.3 %Ryan Uy, 2509 %Section B05, Tues. 3-4 %Given values: speed in sand = 2 mi/hr, speed on trail = 3.5 mi/hr %cos(theta) = 3.25 miles / distance traveled in sand %Distance traveled in sand = 3.25 miles / cos(theta) %Make an array for the different angles, then covert to radians theta = [0 20 40 60] radians = theta*pi/180 %Distance skipped off trail = 3.25 miles * tan(theta) %Distance walked on trail = 9 miles - distance skipped %Distance walked on trail = 9 - 3.25 * tan(theta) %Transpose radians radians = radians' %Calculate distance walked in the sand and on the trail
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dsand = 3.25 ./ cos(radians) dtrail = 9 - 3.25 .* tan(radians) %Time in hours = distance in sand / 2 + distance on trail / 3.5 t = dsand ./ 2 + dtrail ./ 3.5 %Convert time to hours and minutes hours = floor(t) minutes = 60 * (t - hours) %Transpose hours and minutes and create info array for print statement hours = hours' minutes = minutes' info(1,:) = theta info(2,:) = hours info(3,:) = minutes %Display results fprintf('For theta = %.0f degrees, time to camp = %.0f hr. and %.0f min.\n', info)...
View Full Document

Ask a homework question - tutors are online