**HP 42S and TI-60: Dimensions of a Race Track**

We have a race track that consists of two rectangular tracks connected by a circular ring that is cut in half. A half ring attaches to each end.

Let the variables define the following measurements:

R0 = radius from the center of the circular ring to the outside of the track

RI = radius from the center of the circular ring to the inside of the track

C = length of the rectangular potion of the track

R0 - RI = width of the rectangular portion of the track

I am taking an imaginary line in the middle of the track (see the pink dotted line on the right side of the illustration). The radius from the center of the ring to the pink dotted line is:

RI + (R0 - RI)/2.

Area:

Area

= area of the circular ring + area of the top rectangular portion + area of the bottom rectangular portion

= (π * RO^2 - π * RI^2) + C * (RO - RI) + C * (RO -RI)

= π * (RO^2 - RI^2) + 2 * C * (RO - RI)

Perimeter:

Perimeter

= circumference of the circle at the half way point between the outside and inside radius + length of the top rectangular portion + length of the bottom rectangular potion

= 2 * π * (RI + (RO - RI)/2) + C + C

= 2 * π * (RI + (RO - RI)/2) + 2 * C

= 2 * π * 1/2 * (2 *RI + RO - RI) + 2 * C

= π * (RO - RI) + 2 * C

Now that we have the calculations, let's put them to practice.

Input Variables (see above):

R0 = RO

R1 = RI

R2 = C

Ouput Variables:

R3 = area

R4 = perimeters

**HP 42S/DM42/Free42 Program RACETRK**

00 {68-Byte Prgm}

01 LBL "RACETRK"

02 RCL 00

03 X ↑ 2

04 RCL 01

05 X ↑ 2

06 -

07 PI

08 *

09 2

10 RCL * 02

11 RCL 00

12 RCL - 01

13 *

14 +

15 STO 03

16 "AREA="

17 AVIEW

18 STOP

19 2

20 RCL * 02

21 RCL 01

22 RCL + 00

23 PI

24 *

25 +

26 STO 04

27 "MID PERIMETER="

28 AVIEW

29 RTN

30 END

**TI-60 Program Race Track**

Format: line number : key code : key

00 : 91 : π

01 : 65 : *

02 : 53 : (

03 : 71 : RCL

04 : 00 : 0

05 : 96 : x^2

06 : 75 : -

07 : 71 : RCL

08 : 01 : 1

09 : 96 : x^2

10 : 54 : )

11 : 85 : +

12 : 02 : 2

13 : 65 : *

14 : 71 : RCL

15 : 02 : 2

16 : 65 : *

17 : 53 : (

18 : 71 : RCL

19 : 00 : 0

20 : 75 : -

21 : 71 : RCL

22 : 01 : 1

23 : 54 : )

24 : 95 : =

25 : 61 : STO

26 : 03 : 3

27 : 13 : R/S

28 : 02 : 2

29 : 65 : *

30 : 71 : RCL

31 : 02 : 2

32 : 85 : +

33 : 91 : π

34 : 65 : *

35 : 53 : (

36 : 71 : RCL

37 : 00 : 0

38 : 85 : +

39 : 71 : RCL

40 : 01 : 1

41 : 54 : )

42 : 95 : =

43 : 61 : STO

44 : 04 : 4

45 : 13 : R/S

46 : 22 : RST

**Example**

R0 = radius to outside ring = 12 ft

R1 = radius to inside ring = 8 ft

R2 = length of the rectangular portion of the trace = 45 ft

Results:

Area (R3) = 611.3274123 ft^2

Perimeter of the mid-line (R4) = 152.8318531 ft

Eddie

All original content copyright, © 2011-2019. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.