How to resolve the algorithm Shoelace formula for polygonal area step by step in the Phix programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Shoelace formula for polygonal area step by step in the Phix programming language

Table of Contents

Problem Statement

Given the n + 1 vertices x[0], y[0] .. x[N], y[N] of a simple polygon described in a clockwise direction, then the polygon's area can be calculated by: (Where abs returns the absolute value) Write a function/method/routine to use the the Shoelace formula to calculate the area of the polygon described by the ordered points:

Show the answer here, on this page.

Let's start with the solution: