Gin
Loading...
Searching...
No Matches
Classes | Functions
geometry

Classes

class  Catenary
 Calculates the curve of a hanging cable (catenary). More...
 
class  Ellipse< T >
 Equations to calculate the shape of an ellipse and to calculate points on the edge of the ellipse and to see if points are inside or outside. More...
 
class  Polygon< T >
 A simple polygon defined by a series of points. More...
 

Functions

template<typename T >
square (T in)
 Returns the square of a value.
 
template<typename T >
bool solveLine (T x1, T y1, T x2, T y2, T &m, T &b)
 Solves for the slope and intercept of a line given two points.
 

Detailed Description

Function Documentation

◆ square()

template<typename T >
T square ( in)

Returns the square of a value.

Parameters
inThe value to square
Returns
in * in

◆ solveLine()

template<typename T >
bool solveLine ( x1,
y1,
x2,
y2,
T &  m,
T &  b 
)

Solves for the slope and intercept of a line given two points.

Calculates m and b in the equation y = mx + b from two points on the line.

Parameters
x1X coordinate of the first point
y1Y coordinate of the first point
x2X coordinate of the second point
y2Y coordinate of the second point
mOutput: the slope of the line
bOutput: the y-intercept of the line
Returns
true if the line could be solved (returns false for vertical lines)