geometryarea

right triangle

Only available under a commercial licence
COST (GBP)
this unit 0.80
sub units 0.00
add a commercial licence to your cart
0
viewed 1105 times
www.codecogs.com/d-ox/geometry/area/right_triangle.php
Controller: CodeCogs    Contact Controller

Interface

#include <codecogs/geometry/area/right_triangle.h>

using namespace Geometry::Area;

double right_triangle (double a, double b, double c, double h)[inline]
Computes the area of a trapezium within a right angled triangle with a fixed edge.
Click for details on using CodeCogs in ExcelReal cc_right_triangle (Real a, Real b, Real c, Real h)
This function is available as a Microsoft Excel add-in.

Function Documentation

Add calculator to your site or email
 
doubleright_triangledoublea
doubleb
doublec
doubleh )[inline]
This module computes the area of the trapezium formed between a right angled triangle with a fixed edge on a reference line and a line found at a given distance distance from this reference line.

This situation is described by the following image. The area which we want to compute is that of the filled trapezium [BB_1C_1C] .

1/right_triangle-746.jpg
Solution

Let \mathrm{xOy} be an orthogonal coordinate system and let \triangle ABC be a right angled triangle (\angle C = 90^{\circ} ) so that BC \subset \mathrm{Ox} and
(1)
\displaystyle 
BC = a \qquad AC = b \qquad AB = c
where a, b, c \in \mathbb{R}_+^* are fixed numbers. Also let d \parallel \mathrm{Ox} so that the distance from line d to \mathrm{Ox} is h \in \mathbb{R}_+ and AB \cap d = \{B_1\} , AC \cap d = \{C_1\} .

Obviously \triangle AB_1C_1  \sim \triangle ABC , which implies:
(2)
\displaystyle \frac{B_1C_1}{BC} = \frac{b-h}{b} \qquad \Rightarrow \qquad B_1C_1 = a\frac{b-h}{B}
Thus:
(3)
\displaystyle \mathcal{A}_{[BB_1C_1C]} = (BC + B_1C_1)\frac{h}{2} = \frac{ah}{2}\left( 2 - \frac{h}{b} \right)
To conclude, the solution of the problem is:
(4)
\displaystyle \mathcal{A}_{[BB_1C_1C]} = ah - \frac{ah^2}{2b}
Example:
#include <codecogs/geometry/area/right_triangle.h>
#include <stdio.h>
 
int main()
{
  // the lengths of the sides
  double a = 3.0, b = 4.0, c = 5.0;
 
  // display the lengths of the sides
  printf("a = %.1lf\nb = %.1lf\nc = %.1lf\n\n", a, b, c);
 
  // display the area for different values of h
  for (double h = 0.1; h < 1.09; h += 0.1)
    printf("h = %.1lf   Area = %.2lf\n", h, Geometry::Area::right_triangle(a, b, c, h));
 
  return 0;
}
Output:
a = 3.0
b = 4.0
c = 5.0
 
h = 0.1   Area = 0.30
h = 0.2   Area = 0.59
h = 0.3   Area = 0.87
h = 0.4   Area = 1.14
h = 0.5   Area = 1.41
h = 0.6   Area = 1.66
h = 0.7   Area = 1.92
h = 0.8   Area = 2.16
h = 0.9   Area = 2.40
h = 1.0   Area = 2.62
Parameters:
afirst side of the triangle (BC)
bsecond side of the triangle (AC)
cthird side of the triangle (AB)
hthe distance between line d and \mathrm{Ox}
Returns:
The value of the desired area.
Note:
The values of the sides must be Pythagorean numbers, i.e. satisfying the equality:
(5)
\displaystyle a^2 + b^2 = c^2.
Authors:
Eduard Bentea (September 2006)
Source Code:
Register

- To get code register with CodeCogs. Already a Member, then Login.


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2008-05-13 20:14:30

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional