, Visual C#


         

theta1 = pi * 0.4 : theta2 = pi * 0.8


theta1 = pi * 0.4 : theta2 = pi * 0.8
s1 = CSng(Sin(theta1))
c1 = CSng(Cos(theta1))
s2 = CSng(Sin(theta2))
c2 = CSng(Cos(theta2))
M = 1 - (2 - 2 * c1 - 4 * s1 * s1) / (2 * c1 - 2)
N = CSng(Sqrt((2 - 2 * c1) - M * M)) * _
(1 + (1 - c2) / (c1 - c2)) : R = 2 / N
S = R * CSng(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 = CSng(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)
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)