[Algorithm] Area of polygon

How to calculate the area of polygon. For a triangle like:
[Algorithm] Area of polygon

We can calculate the area:

function cross_product(a, ,b) {
    return a.x * b.y - a.y * b.x
}
function area (a, b) {
   cross_product(a, b) / 2.0
}

 

This approach is able to solve all simple polygon areas problem:

[Algorithm] Area of polygon

上一篇:vim插件cscope使用方法


下一篇:[ZJOI2019]浙江省选(半平面交)