geometryarea

free triangle

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

Interface

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

using namespace Geometry::Area;

double free_triangle (double a, double b, double c, double h, double alpha)[inline]
Computes the area of a triangle or a trapezium within a triangle with a fixed vertex.
Click for details on using CodeCogs in ExcelReal cc_free_triangle (Real a, Real b, Real c, Real h, Real alpha)
This function is available as a Microsoft Excel add-in.

Function Documentation

Free Triangle Calculator

  

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

The various cases are described by the images given in the following documentation, where the area which we want to compute is that of the filled shape.

Solution

Let \mathrm{xOy} be an orthogonal coordinate system and let \triangle ABC be an arbitrary triangle so that A \in \mathrm{Ox} and
(1)
\displaystyle BC = a \qquad AC = b \qquad AB = c
where a, b, c \in \mathbb{R}_+^* are fixed numbers. Consider \alpha = \angle CAX and d \parallel \mathrm{Ox} so that the distance between the line d and \mathrm{Ox} equals h \in \mathbb{R}_+ . Also let d \cap AB = \{B_1\} and d \cap AC = \{C_1\} .

We will first find the lengths of the projections of B and C on \mathrm{Ox} because we can separate different cases based on these values. Let d(B,\mathrm{Ox}) = h_b and d(C,\mathrm{Ox}) = h_c . Since these values are independent of the relations set between them and h we can consider, without loss of generality, the following case: h_b > h and h_c > h .

1/free_triangle01-746.jpg

Further information available when you purchase a licence.

Let S be the area which we must determine. Based on the values of h_b , h_c and h , we find the following solutions:

1) h_b \leq h , h_c \leq h \Rightarrow S = \mathcal{A}_{\triangle ABC}

1/free_triangle_2-746.jpg

Further information available when you purchase a licence.

2) h_b \geq h, h_c \geq h\f \Rightarrow S = \mathcal{A}_{\triangle AB_1C_1}

1/free_triangle_3-746.jpg

Further information available when you purchase a licence.

3) h_b < h, h_c > h\f \Rightarrow S = \mathcal{A}_{[ABB_1C_1]}

1/free_triangle_4-746.jpg

Further information available when you purchase a licence.

4) h_b > h, h_c < h\f \Rightarrow S = \mathcal{A}_{[ABB_1C_1]}

1/free_triangle_5-746.jpg

Further information available when you purchase a licence.

Output:
a = 2.613
b = 1.878
c = 1.209
alpha = 0.61086
 
h = 0.0   Area = 0.00
h = 0.3   Area = 0.14
h = 0.6   Area = 0.56
h = 0.9   Area = 0.97
h = 1.2   Area = 1.04
h = 1.5   Area = 1.04
Example:
#include <codecogs/geometry/area/free_triangle.h>
#include <stdio.h>
 
int main()
{
  // the lengths of the sides
  double a = 2.613, b = 1.878, c = 1.209;
 
  // the value of the alpha angle in radians
  double alpha = 0.61086;
 
  // display the lenghts of the sides and the alpha angle
  printf("a = %.3lf\nb = %.3lf\nc = %.3lf\nalpha = %.5lf \n\n", a, b, c, alpha);
 
  // display the area for different values of h
  for (double h = 0.0; h < 1.6; h += 0.3)
  printf("h = %.1lf   Area = %.2lf\n", h, 
  Geometry::Area::free_triangle(a, b, c, h, alpha));
  
  return 0;
}
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}
alphathe input angle in radians
Returns:
The value of the desired area.
Note:
The vertices must be denoted such that the abscissa of B is less than that of C , i.e. as in the given examples.
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-14 17:18:25

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional