12 lines
568 B
C++
12 lines
568 B
C++
|
#include "ScaleneTriangle.h"
|
||
|
#include "GeometryUtils.h"
|
||
|
|
||
|
bool ScaleneTriangle::validate() {
|
||
|
double sideOne = calculate_distance(mVertices[0], mVertices[1]);
|
||
|
double sideTwo = calculate_distance(mVertices[1], mVertices[2]);
|
||
|
double sideThree = calculate_distance(mVertices[2], mVertices[0]);
|
||
|
|
||
|
// Scalene triangles must (a) Be a triangle and (b) Have no sides that equal each other
|
||
|
return lengths_make_triangle(sideOne, sideTwo, sideThree)
|
||
|
&& (!double_eq(sideOne, sideTwo) && !double_eq(sideTwo, sideThree) && !double_eq(sideThree, sideOne));
|
||
|
}
|