[UP]


Manual Reference Pages  - area_of_simple_polygon (1)

NAME

area_of_simple_polygon(1f) - determine area of simple (non-intersecting) polygon given coordinates of points (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

area_of_simple_polygon [file(s)|[ --help| --version]]

DESCRIPTION

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.

OPTIONS

filenames
  name of files containing xy pairs defining a simple polygon
--help display this help and exit
--version
  output version information and exit

EXAMPLE

Given file in.1 with the following contents:

   -5 -5
   0 0
   -5 5
   5 5
   0 0
   5 -5

Expected 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

AUTHOR

John S. Urban

LICENSE

Public Domain


area_of_simple_polygon (1) March 11, 2021
Generated by manServer 1.08 from e432fdcf-6395-4f6d-b558-a416fd515ca8 using man macros.