Exemple #1
0
// Computes area of quads that are possibly non-rectangular. Can be easily extended to polygons.
static inline float quadArea(const FloatQuad& quad)
{
    return fabs(0.5 * (wedgeProduct(quad.p1(), quad.p2()) +
                       wedgeProduct(quad.p2(), quad.p3()) +
                       wedgeProduct(quad.p3(), quad.p4()) +
                       wedgeProduct(quad.p4(), quad.p1())));
}
Exemple #2
0
 double anticlockAngle(Vector2D * rh)
 {
     double det = wedgeProduct(rh);
     
     double sint = det / (norm() * rh->norm());
     
     return asin(sint);
 }