{"id":23845,"date":"2021-10-05T20:28:41","date_gmt":"2021-10-05T14:58:41","guid":{"rendered":"https:\/\/python-programs.com\/?p=23845"},"modified":"2021-11-22T18:33:25","modified_gmt":"2021-11-22T13:03:25","slug":"python-program-for-area-of-a-polygon-with-given-n-ordered-vertices","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-area-of-a-polygon-with-given-n-ordered-vertices\/","title":{"rendered":"Python Program for Area of a Polygon with Given n Ordered Vertices"},"content":{"rendered":"

Given two lists which are the ordered coordinates of a polygon with n vertices, the task is to find the area of a given polygon.<\/p>\n

Ordered means that the coordinates are given either clockwise or anticlockwise from the first vertex to the last.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given x-coordinates list = [1, 5, 1]\r\nGiven y-coordinates list = [6, 4, 3]<\/pre>\n

Output:<\/strong><\/p>\n

The Area of the given polygon for the given n ordered vertices :\r\n6<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given x-coordinates list = [2, 3, 3, 1]\r\nGiven y-coordinates list = [9, 2, 1, 2]<\/pre>\n

Output:<\/strong><\/p>\n

The Area of the given polygon for the given n ordered vertices :\r\n8<\/pre>\n

Program for Area of a Polygon with Given n Ordered Vertices in Python<\/h2>\n

Below are the ways to find the area of a given polygon for the given n ordered vertices in python:<\/p>\n