Welcome to mirror list, hosted at ThFree Co, Russian Federation.

triangle2d.hpp « geometry - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7cd828b96c263882081afbd450420b5f6620dbdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once

#include "point2d.hpp"

namespace m2
{

template <class T>
double GetTriangleArea(Point<T> const & p1, Point<T> const & p2, Point<T> const & p3)
{
  return 0.5 * fabs((p2.x - p1.x)*(p3.y - p1.y) - (p3.x - p1.x)*(p2.y - p1.y));
}

}