Calculate Area of Irregular Polygon with C++ - Eong Koungmeng

Eong Koungmeng - អ៊ឹង គួងម៉េង

Hot

Post Top Ad

Saturday, 23 July 2022

Calculate Area of Irregular Polygon with C++

About program

Use C++ to calculate area using shoelace formula.

Usage

To calculate area you need to change the variable number_of_polygon to the number of polygon your shape has. And change the coordinates array to the coordinate of each vertices of your shape. You need to list it in counter-clockwise position, and don't forget to add the first vertex to the back of the array to create a loop.

Example and output



No comments:

Post a Comment

Post Top Ad