- l[{n_}, theta_] :=
- (2*Pi/n) ((n*theta/(2*Pi)) - IntegerPart[n*theta/(2*Pi)]);
- k[{a_, b_, ll_, p_, w1_, w2_, n_}, s_, theta_] :=
- If[w1 == 0 || w2 == 0 || n == 0,
- 0,
- ll*Exp[-(2*(s - p)/w1)^2 - (2*l[{n}, theta]/w2)^2]
- ];
- h[{a_, b_, ll_, p_, w1_, w2_, n_}, s_, theta_] :=
- (1/(Sqrt[(Cos[s]/a)^2 + (Sin[s]/b)^2]))
- +k[{a, b, ll, p, w1, w2, n}, s, theta];
- (*cartesian coordinates*)
- x[{d_, aa_, beta_, phi_, omega_, mu_, alpha_, a_, b_, ll_, p_, w1_,
- w2_, n_}, theta_, s_] :=
- d*(aa*Sin[beta]*Cos[theta]
- + h[{a, b, ll, p, w1, w2, n}, s,
- theta]*(Cos[s + phi]*Cos[theta + omega] -
- Sin[mu]*Sin[s + phi]*Sin[theta + omega]))*
- Exp[theta*Cot[alpha]];
- y[{aa_, beta_, phi_, omega_, mu_, alpha_, a_, b_, ll_, p_, w1_, w2_,
- n_}, theta_, s_] :=
- (-aa*Sin[beta]*Sin[theta] -
- h[{a, b, ll, p, w1, w2, n}, s,
- theta]*(Cos[s + phi]*Sin[theta + omega] +
- Sin[mu]*Sin[s + phi]*Cos[theta + omega]))*
- Exp[theta*Cot[alpha]];
- z[{aa_, beta_, phi_, mu_, alpha_, a_, b_, ll_, p_, w1_, w2_, n_},
- theta_, s_] :=
- (-aa*Cos[beta] +
- h[{a, b, ll, p, w1, w2, n}, s, theta]*Sin[s + phi]*Cos[mu])*
- Exp[theta*Cot[alpha]];
- (*sample*)
- With[{d = 1, aa = 90, beta = 10 Degree, phi = 45 Degree,
- omega = 1 Degree, mu = 5 Degree, alpha = 86 Degree, a = 20, b = 20,
- ll = 14, p = 0, w1 = 180, w2 = .4, n = 180},
- ParametricPlot3D[{x[{d, aa, beta, phi, omega, mu, alpha, a, b, ll, p,
- w1, w2, n}, theta, s],
- y[{aa, beta, phi, omega, mu, alpha, a, b, ll, p, w1, w2, n}, theta,
- s],
- z[{aa, beta, phi, mu, alpha, a, b, ll, p, w1, w2, n}, theta, s]},
- {theta, -10*Pi, 10*Pi},
- {s, -270 Degree, 90 Degree},
- PlotRange -> All, PlotPoints -> 50, Mesh -> False, Boxed -> False,
- Axes -> False,
- PlotStyle -> {Darker[Orange, 0.1], Specularity[White, 20]},
- Background -> GrayLevel[0.5],
- SphericalRegion -> True,
- ViewPoint ->
- RotationTransform[-3 Pi/4, {0, 2, 1}][{3 Cos[-3 Pi/4/7] + 2,
- Cos[3 - 3 Pi/4], 5 + 2 Sin[-3 Pi/4 7]}]]
- ]