, Visual C#


- 4


DesigningLine(1, -1, -1, -1, -1, -1);

DesigningLine(-1, -1, 1, -1, 1, 1);

DesigningLine(-1, 1, 1, 1, 1, 1);

DesigningLine(1, 1, 1, 1, -1, 1);

DesigningLine(1, -1, 1, -1, -1, 1);

DesigningLine(-1, -1, -1, -1, -1, 1);

DesigningLine(-1, 1, -1, -1, 1, 1);

DesigningLine(1, 1, -1, 1, 1, 1);

DesigningLine(1, -1, -1, 1, -1, 1);

// (Octahedron):

Octahedron = NumLines + 1;

DesigningLine(0, 1, 0, 1, 0, 0);

DesigningLine(0, 1, 0, -1, 0, 0);

DesigningLine(0, 1, 0, 0, 0, 1);

DesigningLine(0, 1, 0, 0, 0, -1);

DesigningLine(0, -1, 0, 1, 0, 0);

DesigningLine(0, -1, 0, -1, 0, 0);

DesigningLine(0, -1, 0, 0, 0, 1);

DesigningLine(0, -1, 0, 0, 0, -1);

DesigningLine(0, 0, 1, 1, 0, 0);

DesigningLine(0, 0, 1, -1, 0, 0);

DesigningLine(0, 0, -1, 1, 0, 0);

DesigningLine(0, 0, -1, -1, 0, 0);

// (Dodecahedron):

Dodecahedron = NumLines + 1;

theta1 = (float)(pi * 0.4); theta2 = (float)(pi * 0.8);

s1 = (float)Math.Sin(theta1);

c1 = (float)Math.Cos(theta1);

s2 = (float)Math.Sin(theta2);

c2 = (float)Math.Cos(theta2);

M = 1 - (2 - 2 * c1 - 4 * s1 * s1) / (2 * c1 - 2);

N = (float)Math.Sqrt((2 - 2 * c1) - M * M) *

(1 + (1 - c2) / (c1 - c2)); R = 2 / N;

S = (float)(R * Math.Sqrt(2 - 2 * c1));

A = R * s1; B = R * s2; C = R * c1; D = R * c2;

H = R * (c1 - s1);

X = (R * R * (2 - 2 * c1) - 4 * A * A) /

(2 * C - 2 * R);

Y = (float)Math.Sqrt(S * S - (R - X) * (R - X));

y2 = Y * (1 - c2) / (c1 - c2);

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);

DesigningLine(R, 1, 0, X, 1 - Y, 0);

DesigningLine(C, 1, A, X * c1, 1 - Y, X * s1);

DesigningLine(C, 1, -A, X * c1, 1 - Y, -X * s1);

DesigningLine(D, 1, B, X * c2, 1 - Y, X * s2);

DesigningLine(D, 1, -B, X * c2, 1 - Y, -X * s2);




- -  - -  - -