- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Find area of parallelogram if vectors of two adjacent sides are given using C++.

Suppose we have two vectors for two adjacent sides of a parallelogram in the form $x\hat{i}+y\hat{j}+z\hat{k}$ Our task is to find the area of parallelogram. The area of parallelogram is magnitude of the cross product of two vectors. (|A × B|)

$$\rvert \vec{A}\times\vec{B}\rvert=\sqrt{\lgroup y_{1}*z_{2}-y_{2}*z_{1}\rgroup^{2}+\lgroup x_{1}*z_{2}-x_{2}*z_{1}\rgroup^{2}+\lgroup x_{1}*y_{2}-x_{2}*y_{1}\rgroup^{2}}$$

## Example

#include<iostream> #include<cmath> using namespace std; float area(float A[], float B[]) { float area = sqrt(pow((A[1] * B[2] - B[1] * A[2]),2) + pow((A[0] * B[2] - B[0] * A[2]),2) + pow((A[0] * B[1] - B[0] * A[1]),2)); return area; } int main() { float A[] = {3, 1, -2}; float B[] = {1, -3, 4}; float a = area(A, B); cout << "Area = " << a; }

## Output

Area = 17.3205

- Related Articles
- Find area of triangle if two vectors of two adjacent sides are given using C++
- To find the weight of a given Body using Parallelogram Law of Vectors
- How to find the perimeter of a parallelogram with two adjacent sides of 18 and 20cm?
- Two adjacent angles of parallelogram are in the ratio $2:7$. Find the angles of parallelogram.
- If an angle of a parallelogram is two-third of its adjacent angle, find the angles of the parallelogram.
- The adjacent sides of a parallelogram $ABCD$ measures $34 cm$ and $20 cm$, and the diagonal $AC$ measures $42 cm$. Find the area of the parallelogram.
- If two adjacent angle of a parallelogram are $( 5x-5)$ and $( 10x+35)$, then find the ratio of these angles.
- Let $ABCD$ be a parallelogram of area $124 cm^2$. If $E$ and $F$ are the mid-points of sides $AB$ and $CD$ respectively, then find the area of parallelogram $AEFD$.
- Two adjacent angles of a parallelogram have equal measure. Find the measure of each of the angles of the parallelogram.
- The measures of two adjacent angles of a parallelogram are in the ratio 3:2. Find the measure of each of the angles of the parallelogram.
- The ratio of two sides of a parallelogram is 2 : 3 and its perimeter is 60 cm. Find the sides of the parallelogram.
- Draw a rough sketch of a quadrilateral KLMN. State,(a) two pairs of opposite sides,(b) two pairs of opposite angles,(c) two pairs of adjacent sides,(d) two pairs of adjacent angles.
- The perimeter of a parallelogram is 60 cm and the ratio of its adjacent sides is 3:2. If the altitude corresponding to the largest side of the parallelogram is 5 cm. Find the area of the parallelogram and the altitude corresponding to the smaller side.
- Two sides of a parallelogram are in the ratio 5:3. if its perimeter is 64 cm find the length of its side.
- Two adjacent angles of a parallelogram are (3x-4)° and (3x+16)°. Find the value of x and hence find the measure of the two angles.

Advertisements