Parametrized Helicoid plot becomes a cone + "Arrow=True" is not working for 3-D

Hi all,

I might misunderstood the parametrized conversion to the code from this site:

I follow the parametrized helicoid and it becomes a cone:

Capture d’écran_2023-06-23_17-30-02

using Plots;
gr() 

function helicoid(r)   
    n = 100
    θ = range(0, 2π; length = n)
    u = range(0, 1; length = n)
    x = r*u*cos.(θ)'
    y = r*u*sin.(θ)'
    z = θ*ones(size(u))'
    return x, y, z
end
my_cg = cgrad([:red,:blue])
surface(helicoid(3), c=my_cg, label="helicoid", arrow=true, arrowsize=5)

another one, the arrow=true does not showing any arrow. I try with helix that is working and the arrow is not there.

using Plots;
gr() 
#plotlyjs()

# a helix is a curve in 3-dimensional space. 
# The following parametrisation in Cartesian coordinates defines a particular helix;

function helix(r)   
    n = 100
    θ = range(-10, 10; length = n)
    x = r*cos.(θ)
    y = r*sin.(θ)
    z = θ
    return x, y, z
end
my_cg = cgrad([:red,:blue])
plot(helix(5), c=my_cg, label="helix", arrow=true, arrowsize=5)

using Plots;
gr()

function helicoid(r)   
    n = 100
    θ = range(-2pi, 2π; length = n)
    u = range(-10, 10; length = n)
    x = r*u*cos.(θ)'
    y = r*u*sin.(θ)'
    z = ones(size(u))*θ'
    return x, y, z
end
my_cg = cgrad([:red,:blue])
surface(helicoid(3),  label="helicoid")

1 Like