, Visual C#


         

(Icosahedron):


DesigningLine(X, 1 - Y, 0, -X * c2, 1 - y2, -X * s2);
DesigningLine(X, 1 - Y, 0, -X * c2, 1 - y2, X * s2);
DesigningLine(X * c1, 1 - Y, X * s1,
-X * c2, 1 - y2, X * s2);
DesigningLine(X * c1, 1 - Y, X * s1,
-X * c1, 1 - y2, X * s1);
DesigningLine(X * c2, 1 - Y, X * s2,
-X * c1, 1 - y2, X * s1);
DesigningLine(X * c2, 1 - Y, X * s2, -X, 1 - y2, 0);
DesigningLine(X * c2, 1 - Y, -X * s2, -X, 1 - y2, 0);
DesigningLine(X * c2, 1 - Y, -X * s2,
-X * c1, 1 - y2, -X * s1);
DesigningLine(X * c1, 1 - Y, -X * s1,
-X * c1, 1 - y2, -X * s1);
DesigningLine(X * c1, 1 - Y, -X * s1,
-X * c2, 1 - y2, -X * s2);
DesigningLine(-R, -1, 0, -X, 1 - y2, 0);
DesigningLine(-C, -1, A, -X * c1, 1 - y2, X * s1);
DesigningLine(-D, -1, B, -X * c2, 1 - y2, X * s2);
DesigningLine(-D, -1, -B, -X * c2, 1 - y2, -X * s2);
DesigningLine(-C, -1, -A, -X * c1, 1 - y2, -X * s1);
DesigningLine(-R, -1, 0, -C, -1, A);
DesigningLine(-C, -1, A, -D, -1, B);
DesigningLine(-D, -1, B, -D, -1, -B);
DesigningLine(-D, -1, -B, -C, -1, -A);
DesigningLine(-C, -1, -A, -R, -1, 0);
// (Icosahedron):
Icosahedron_first = NumLines + 1;
R = (float)(2f / (2f * Math.Sqrt(1 - 2f * c1) +
Math.Sqrt(3f / 4f * (2f - 2f * c1) -
2f * c2 - c2 * c2 - 1f)));
S = R * (float)Math.Sqrt(2 - 2 * c1);
H = 1 - (float)Math.Sqrt(S * S - R * R);
A = R * s1; B = R * s2; C = R * c1; D = R * c2;
DesigningLine(R, H, 0, C, H, A);
DesigningLine(C, H, A, D, H, B);
DesigningLine(D, H, B, D, H, -B);
DesigningLine(D, H, -B, C, H, -A);
DesigningLine(C, H, -A, R, H, 0);
DesigningLine(R, H, 0, 0, 1, 0);
DesigningLine(C, H, A, 0, 1, 0);
DesigningLine(D, H, B, 0, 1, 0);
DesigningLine(D, H, -B, 0, 1, 0);
DesigningLine(C, H, -A, 0, 1, 0);