pythgen
Pythagoras Generalized Theorem implementation
You're viewing an older version of this page (#1031). View the current version.
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:
This can easily be proven using normal Pythagoras Theorem in the ADC triangle:
However,
and
Thus, using the last three equations:
which is
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
Returns
Victor Larie (May 2010)
Interactive Calculator
Computing…
Set a range above first to export a graph.
FUNCTION
pythgen_PythagorasGen
Parameters
Returns
Victor Larie (May 2010)
Interactive Calculator
Computing…
Set a range above first to export a graph.