Decided to bite the bullet and do one up myself…
from what I can tell all the equations for the inner circles and lines meet Apples design.
The outer RoundRect is a super close approximation, as Apple uses a SuperEllipse
If anyone can adapt the math for a SuperEllipse to this code, PLEASE let me know
This is free for anyone to use, but please keep the comments intact
FUNCTION ios_TEMPLATE(size As Double) As Picture
//
// Create a Apple Icon Golden Ratio Template
// Note : not 100% exact, but pretty dang close
//
// Author : R.David S
// Date : 22-Dec-2014
//
// All math is based on 1024x1024
//
Const golden_ratio As Double=1.6180339887
Dim p As Picture
Dim g As Graphics
Dim x As Double
Dim y As Double
Dim a As Double
Dim b As Double
Dim z As Double
Dim r As Double
size=Floor(size) // can't have a fractional icon size
p=New picture(size,size)
g=p.graphics
//
g.ForeColor=&cfefefe
g.fillrect 0,0,size,size
//
// Approximation of RoundRect Radius based on 1024x1024
// note : this is NOT precise, but as close as I could figue
//
r=((((512)-((512-64)/golden_ratio)))*2)-35
r=(r/1024)*size
//
g.ForeColor=&cffffff
g.fillrect 0,0,size,size
g.ForeColor=&cccffff
g.FillRoundRect 0,0,size,size, r,r
g.ForeColor=&c000000
g.DrawRoundRect 0,0,size,size, r,r
//
// Begin Drawing Lines and Circles
//
x=(64/1024)*size ' distance from 0,0 to outer square corner
a=(size/2)-x
b=a/golden_ratio
//
//
// draw diagonal lines
//
g.drawline 0,0,size,size
g.drawline size,0,0,size
//
// draw center horizontal/vertical
//
g.drawline size/2,0,size/2,size
g.drawline 0,size/2,size,size/2
//
// draw upper/lower horizontal lines
//
g.drawline 0,x,size,x
g.drawline 0,size-x,size,size-x
//
// draw left/right vertical lines
//
g.drawline x,0,x,size
g.drawline size-x,0,size-x,size
//
// draw outter circle
//
g.DrawOval x,x,size-2*x,size-2*x
//
// draw inner horizontal lines
//
y=(size/2)/golden_ratio
g.drawline 0,y,size,y
g.drawline 0,size-y,size,size-y
g.drawline y,0,y,size
g.drawline size-y,0,size-y,size
//
// draw inner circle
//
g.DrawOval y,y,size-2*y,size-2*y
//
z=(size/2)-b
g.drawOval z,z,size-2*z,size-2*z
Return p
END FUNCTION