The Museum of HP Calculators

# Area of a Polygon for the HP-55

This program is Copyright © 1975 by Hewlett-Packard and is used here by permission. This program was originally published in "HP-55 Mathematics Programs".

This program is supplied without representation or warranty of any kind. Hewlett-Packard Company and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

## Overview

If the x-y coordinates of the vertices of a polygon are known, the area can be found by the following formula:

Area = 0.5 * [(x1 + x2)(y1 - y2) + (x2 + x3)(y2 - y3) + . . . + (xn + x1)(yn - y1)]

Traverse the coordinates clockwise for a positive area.

## Instructions

 Step Instructions Input Data/Units Keys Output Data/Units 1 Enter program 2 Input (x1, y1) x1* ENTER y1* BST R/S 0.0 3 Input (xi, yi) for i = 2, . . ., n xi ENTER yi R/S intermediate 4 Input (x1, y1) again x1 ENTER y1 R/S Area * if x1 & y1 are complicated you can store them in R6 and R7 for step 4.

## Example

For a polygon with the points (1,3), (2,4), (5,4), (5,7) (7,5), (7,1), (3,1), the area would be 19.50.

## The Program

```LINE CODE KEYS
00.
01.   33  STO
02.   02  2
03.   23  roll dn
04.   33  STO
05.   01  1
06.   00  0
07.   33  STO
08.   05  5
09.   84  R/S
10.   33  STO
11.   04  4
12.   23  roll dn
13.   33  STO
14.   03  3
15.   34  RCL
16.   01  1
17.   61  +
18.   34  RCL
19.   02  2
20.   34  RCL
21.   04  4
22.   51  -
23.   71  x
24.   02  2
25.   81  ÷
26.   33  STO
27.   61  +
28.   05  5
29.   34  RCL
30.   04  4
31.   33  STO
32.   02  2
33.   34  RCL
34.   03  3
35.   33  STO
36.   01  1
37.   34  RCL
38.   05  5
39.  -09  GTO 09
```

## Register Use

```R1  xi-1
R2  yi-1
R3  xi
R4  yi
R5  area
```