pythgen
Pythagoras Generalized Theorem implementation
Interface
#include <codecogs/maths/geometry/pythgen.h>
using namespace Maths::Geometry;
Overview
The aim of this module is to implement Pythagoras Generalized Theorem. Given any triangle knowing the value of two sides and the angle between them, one can find out the value of the third side.

According to Pythagora's Generalized Theorem the value of AC side is:
(1)
This can easily be proven using normal Pythagoras Theorem in the ADC triangle:
(2)
However,
(3)
and
(4)
Thus, using the last three equations:
(5)
which is
(6)
Example 1
#include <stdio.h>
#include <codecogs/maths/geometry/pythgen.h>
int main()
{
//an equal-sided triangle with the side value of 3.5
double thirdSide = pythgen_PythagorasGen(3.5,3.5,60);
printf("\nThe value of the 3rd side: %.2lf", thirdSide);
return 0;
}Output
The value of the 3rd side: 3.50FUNCTION
pythgen_SetAngleDegRad
Parameters
alpha
value of angle measured in degrees
Returns
value of angle measured in radians
Author
Victor Larie (May 2010)
Interactive Calculator
alpha
Result
Computing…
Set a range above first to export a graph.
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.
FUNCTION
pythgen_PythagorasGen
Parameters
x
the value of one side of the triangle
y
the value of another side of the triangle
alpha
the value of the angle between the sides given in degrees
Returns
the value of the third side of the triangle
Author
Victor Larie (May 2010)
Interactive Calculator
x
y
alpha
Result
Computing…
Set a range above first to export a graph.
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.