Трехмерный график: роза¶
In [ ]:
n = 800;
A = 1.995653;
B = 1.27689;
C = 8;
r = range( 0, 1, length=n );
theta=range( -2, 20*pi, length=n);
THETA = repeat(collect(theta)', length(r))
R = repeat(collect(r)', length(theta))'
# Количество лепестков за один оборот
petalNum=3.6;
x = @. 1-(1/2)*((5/4)*(1-mod(petalNum*THETA, 2*pi)/pi)^2-1/4)^2
phi = @. (pi / 2) * exp(-THETA / (C*pi))
y = @. A*(R^2)*(B*r - 1)^2*sin(phi)
R2 = @. x*(R*sin(phi) + y*cos(phi))
X = @. R2*sin(THETA);
Y = @. R2*cos(THETA);
Z = @. x*( R*cos(phi) - y*sin(phi));
using Plots, Colors, ColorSchemes
cs = ColorScheme([colorant"red", colorant"darkred"])
surface( X, Y, Z, c=cgrad(cs), camera=(40,50), legend=false )
Out[0]: