HP Forums

Full Version: (50g) Bolt Pattern
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Bolt Pattern: BOLTPAT

Link to the original blog entry: http://edspi31415.blogspot.com/2015/03/h...ttern.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
Reference URL's