Given the x, y and z coordinates of three vectors, the task is to check if they are at equilibrium or not.
Input: x1 = -2, y1 = 1, z1 = 0, x2 = 5, y2 = 0, z2 = 5, x3 = -3, y3 = -1, z3 = -5
Output: The vectors are at equilibrium.
Input: x1 = 2, y1 = -17, z1 = 0, x2 = 5, y2 = 1, z2 = -5, x3 = 4, y3 = 2, z3 = -4
Output: The vectors are not at equilibrium.
When Three vectors are at equilibrium
Approach: Three vectors are at equilibrium when the results of those three vectors is a Null vector, i.e. it has no magnitude and direction. Resultant of three vectors is equal to the vector sum of the vectors. The resultant vector is Null when, ∑x = 0, ∑y = 0 and ∑ z = 0. Thus we can say that when the said condition satisfies then the vectors are at equilibrium and otherwise not.
The vectors are at equilibrium.
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Find area of triangle if two vectors of two adjacent sides are given
- Find area of parallelogram if vectors of two adjacent sides are given
- Minimum distance from a point to the line segment using Vectors
- Program for dot product and cross product of two vectors
- Check n^2 - m^2 is prime or not
- Check whether the exchange is possible or not
- Check whether a given number is even or odd
- Check whether it is possible to convert A into B
- Check divisibility by 7
- Check if given coins can be used to pay a value of S
- Check whether N is a Factorion or not
- Check if an Octal number is Even or Odd
- Check if two numbers are co-prime or not
- Check whether a number is semiprime or not
- Check if a number can be expressed as 2^x + 2^y
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.