l2d unit cell area calculation

Former-commit-id: e714f4fb33669138cb45179f323893b3e996fd78
This commit is contained in:
Marek Nečada 2018-12-11 06:51:23 +00:00
parent 8ce2956911
commit f3e1e70b62
2 changed files with 7 additions and 0 deletions

View File

@ -315,6 +315,7 @@ int l2d_cellCornersWS_arr(cart2_t i1, cart2_t i2, cart2_t *oarr, double rtol);
int l2d_reciprocalBasis1(cart2_t b1, cart2_t b2, cart2_t *rb1, cart2_t *rb2);
int l2d_reciprocalBasis2pi(cart2_t b1, cart2_t b2, cart2_t *rb1, cart2_t *rb2);
double l2d_unitcell_area(cart2_t b1, cart2_t b2);
// returns the radius of inscribed circle of a hexagon (or rectangle/square if applicable) created by the shortest base triple
double l2d_hexWebInCircleRadius(cart2_t b1, cart2_t b2);

View File

@ -827,5 +827,11 @@ double l2d_hexWebInCircleRadius(cart2_t i1, cart2_t i2) {
}
double l2d_unitcell_area(cart2_t b1, cart2_t b2) {
l2d_reduceBasis(b1, b2, &b1, &b2);
const double det = b1.x * b2.y - b1.y * b2.x;
return fabs(det);
}