arrow size in 3d curve plots

asked 2023-07-13 18:13:59 +0200

JC gravatar image

Hello to everyone,

Is there a way to control the arrow size in a 3d plot? I can do pretty much what I want in 2d, with, for instance

var('t') x(t) = 2*cos(t) y(t) = sin(t) p1 = [(x(t), y(t)) for t in sxrange(0,pi/2+pi/50, pi/50) ] Fig = arrow2d(path = [[p] for p in p1], aspect_ratio =1, arrowsize = 3, width=1, zorder = 5, color= "red", axes= True, ticks = [[1],[1]],axes_labels = ['$x$','$y$'], axes_labels_size=1.4)

However in 3d, the arrow3d(...)command seems unable to use path =...

I tried something like line3d(... arrow_head = True,...) howeverI can't figure ou how to control the size of the arrow at the end.

There is a related issue here : I use arrows to put axes in my 3d plots, but whtn the aspect_ratiois changed the way the arrows look is modified as well.

Any ideas?

edit retag flag offensive close merge delete



In line3d(... arrow_head = True,...) try radius=0.02 (for example).

achrzesz gravatar imageachrzesz ( 2023-07-13 21:47:21 +0200 )edit

Thanks, I tried what you suggest, but it seems to me like radius =... affects the thickness of the line itself, it does not control the head of the arrow aspect.

JC gravatar imageJC ( 2023-07-14 20:30:29 +0200 )edit

Hello, @JC! Please, let me know if this suits your purposes, so I can make it into an answer.

dsejas gravatar imagedsejas ( 2023-07-15 16:51:59 +0200 )edit

Hello @dsejas. Thanks for your time, what you sugest is a step in the good direction. I would like to be abe to change the color of the arrow. Also, it is not clear at all how the parameter of the arrow3d(...) function control the actual aspect of the arrow. But that's another issue. See an attempr here:

JC gravatar imageJC ( 2023-07-18 20:51:14 +0200 )edit

The color can be changed as follows:

L = [(2*cos(t+pi/4),2*sin(t+pi/4), 4*sin(t+pi/4)^2) 
     for t in sxrange(0,2*pi+pi/80, pi/80)]
            radius=0.04, head_len=1,head_radius=1,color='red')
Fig += plot3d(y^2, (x,-2.1,2.1), (y,-2.1,2.1), color = "orange", opacity = 0.25)
Fig += parametric_plot3d([2*r*cos(t), 2*r*sin(t), 4*r^2 * sin(t)^2], 
    (r,0,1), (t,0,2*pi),  mesh = True, opacity = 0.65, color = "orange")
achrzesz gravatar imageachrzesz ( 2023-07-19 18:46:14 +0200 )edit