Write a program to determine the distance(D) between two points traveled by a boat, given the speed of boat in still water(B), the speed of the stream(S), the time taken to row a place and come back i.e T.
Input : B = 5, S = 1, T = 1 Output : D = 2.4 Input : B = 5, S = 2, T = 1 Output : D = 2.1
Formula for distance is D = T*(B^2 – S^2)/ (2*B)
How does this formula work?
Time taken when person goes upstream, t1 = D/(B-S) Time taken when person goes downstream, t2 = D/(B+S) We are given t1 + t2 = T So, D/(B-S) + D/(B+S) = T D = T*(B^2 - S^2)/ (2*B)
The distance between two points via boat = 2.4 km
- Program to calculate distance between two points
- Program to calculate distance between two points in 3 D
- Speed of boat upstream and downstream
- Minimum number of points to be removed to get remaining points on one side of axis
- Speed of boat in still water from speed of stream and times taken
- Coordinates of rectangle with given points lie inside
- Maximum points of intersection n lines
- Check if two people starting from different points ever meet
- Program to find equation of a plane passing through 3 points
- Distance between a point and a Plane in 3 D
- Farthest distance of a 0 from the center of a 2-D matrix
- Calculate speed, distance and time
- Perpendicular distance between a point and a Line in 2 D
- Find maximum and minimum distance between magnets
- QA - Placement Quizzes | Time Speed Distance | Question 9
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : chitranayal