area_of_simple_polygon(1f) - determine area of simple (non-intersecting) polygon given coordinates of points (LICENSE:PD)
Synopsis
Description
Options
Example
Author
License
area_of_simple_polygon [file(s)|[ --help| --version]]
read file(s) composed of lines of xy pairs and calculate area of polygon, assuming points define a simple (non-intersecting) polygon. If not closed, the last point will be connected to the first point.Shows example of reading arguments from command line of arbitrary length and files of numbers of arbitrary size.
filenames name of files containing xy pairs defining a simple polygon --help display this help and exit --version output version information and exit
Given file in.1 with the following contents:
-5 -5 0 0 -5 5 5 5 0 0 5 -5Expected output:
14 7 2-5.0000000000000000 -5.0000000000000000 0.0000000000000000 0.0000000000000000 -5.0000000000000000 5.0000000000000000 5.0000000000000000 5.0000000000000000 0.0000000000000000 0.0000000000000000 5.0000000000000000 -5.0000000000000000
area= -50.000000000000000
John S. Urban
Public Domain
Nemo Release 3.1 | area_of_simple_polygon (1) | February 23, 2025 |