HP Forums
(50g) Bolt Pattern - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (50g) Bolt Pattern (/thread-3599.html)



(50g) Bolt Pattern - Eddie W. Shore - 04-10-2015 05:04 AM

Bolt Pattern: BOLTPAT

Link to the original blog entry: http://edspi31415.blogspot.com/2015/03/hp-prime-ti-84-bolt-pattern.html


Input:
4: xc: x coordinate, center
3: yc: y coordinate, center
2: n: number of bolts
1: d: diameter of the circle

Program:
<< DEG OVER 1 – → xc yc n d k
<< { } 0 k FOR I 360 I * n / DUP COS d 2 / * xc +
SWAP SIN d 2 / * yc + (0,1) * + + NEXT
DUPDUP 2 GET SWAP 1 GET – ABS >> >>

Output:
2: list of bolts (x+yi)
1: OC-Distance