Area of triangle formed by the axes of co-ordinates and a given straight line?
Here we will see how to get the area of a triangle formed by the x and y axis and another straight line. The diagram will be look like below. The equation of the straight line is −
𝑎𝑥+𝑏𝑦+𝑐=0
The line is cutting the x-axis at the point B, and cutting the y-axis at the point A. The intercept form will be like below −
So the x-intercept is −𝑐∕𝑎 and y-intercept is −𝑐∕𝑏 . So the area of the triangle is
Example
Live Demo
#include<iostream>
#include<cmath>
using namespace std;
double areaTriangle(double a, double b, double c){
return fabs((c*c) / (2*a*b));
}
main() {
double a = -2, b = 4, c = 3;
cout << "Area: " << areaTriangle(a, b, c);
}
Output
Area: 0.5625
Related Articles
- Draw the graph of the equation $\frac{x}{3} + \frac{y}{4} = 1$. Also find the area of the triangle formed by the line and the co-ordinate axes.
- Draw the graphs of the equations $5x\ -\ y\ =\ 5$ and $3x\ -\ y\ =\ 3$. Determine the co-ordinates of the vertices of the triangle formed by these lines and y-axis. Calculate the area of the triangle so formed.
- Draw the graphs of the following linear equation on the same graph paper.$2x + 3y = 12, x -y = 1$Find the co-ordinates of the vertices of the triangle formed by the two straight lines and the y-axis. Also find the area of the triangle.
- Find the area of the triangle formed by joining the mid-points of the sides of the triangle whose vertices are $(0, -1), (2, 1)$ and $(0, 3)$. Find the ratio of this area to the area of the given triangle.
- Explain Co-ordinates in trigonometry.
- Represent a Given Set of Points by the Best Possible Straight Line in C++
- Find the area bounded by the line $x+y=10$ and both the co-ordinate axis.
- Find the ratio in which the line segment joining $(-2, -3)$ and $(5, 6)$ is divided by x-axis. Also, find the co-ordinates of the point of division in each case.
- Find the ratio in which the line segment joining $(-2, -3)$ and $(5, 6)$ is divided by y-axis. Also, find the co-ordinates of the point of division in each case.
- $ABC$ is a triangle and $PQ$ is a straight line meeting $AB$ in $P$ and $AC$ in $Q$. If $AP = 1\ cm, PB = 3\ cm, AQ = 1.5\ cm, QC = 4.5\ cm$, prove that area of $\triangle APQ$ is one-sixteenth of the area of $\triangle ABC$.
- The co-ordinates of the point P are $(-3,2)$. Find the coordinates of the point Q which lies on the line joining P and origin such that $OP = OQ$.
- Minimum height of a triangle with given base and area in C++
- Explain the perimeter and area of a triangle.
- Find the value of $a$ for which the area of the triangle formed by the points $A (a, 2a), B (-2, 6)$ and $C (3, 1)$ is 10 square units.
- Straight Line Method of Calculating Depreciation
Kickstart Your Career
Get certified by completing the course
Get Started