Point -> Vector to a point
Hello everyone,
If i have point in 3D
A=point3d((4,3,2),size=10,color='red',opacity=.5)
How to create a vector from the origin to the point. I know i could define the vector. But I would rather have a point, for plotting reasons
And i would like to plot the Point and the Vector, with automatic labeling of the coordinates.
I have managed to do this like:
from sage.plot.plot3d.shapes2 import frame3d
F=frame3d([0,0,0],vector([10,10,10]),color='red')
A=points((4,3,2),size=10,color='red',opacity=.5)
B=point([(4,3,8)],size=10,color='red',opacity=.5)
t = var('t')
p = vector([4,3,2])
q = vector([0,0,0])
vec=parametric_plot3d(p*t+q, (t,0,1))
#vectB=vector(B.xdata[1],B.ydata[1],B.zdata[1])
e=0.2
eps=vector([4+e,3+e,2+e])
T_A = text3d('A',eps)
#T_B = text3d('B',B)
F+A+T_A+B+vec
Is there any better, way to do it?
Here is the file: https://share.cocalc.com/share/a3f14e...