Given length of sides of equilateral triangle (s), and velocities(v) of each animal tagged on the vertices of triangle, find out the time after which they meet, if they start moving towards their right opposite, forming a trajectory.
Input : s = 2, v = 5 Output : 0.266667 Input : s = 11, v = 556 Output : 0.013189
To find the total amount of time taken for the animals to meet, simply take A divided by the initial rate at which two vertices approach each other. Pick any two vertices, and it can be seen that the first point moves in the direction of the second at speed v, while the second moves in the direction of the first (just take the component along one of the triangle edges).
Reference : StackExchange
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 write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Efficient program to print all prime factors of a given number
- Using Chinese Remainder Theorem to Combine Modular equations
- Trinomial Triangle
- Number of Permutations such that no Three Terms forms Increasing Subsequence
- Check if the first and last digit of the smallest number forms a prime
- Print all substring of a number without any conversion
- Complement of a number with any base b
- Check if Decimal representation of an Octal number is divisible by 7
- Program to find Nth term in the series 0, 2, 1, 3, 1, 5, 2, 7, 3,…
- Program to find GCD or HCF of two numbers using Middle School Procedure