ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 12 Sep 2023 02:25:56 +0200How to plot curve projection?https://ask.sagemath.org/question/73358/how-to-plot-curve-projection/I am newbie to sagemath tool and in the middle of leaning...
I try to plot the projection curve on osculating plane with following code.
But last two line doesn't work.
How can it be done?
Thank you in advance.
E.<x,y,z> = EuclideanSpace()
R.<s> = manifolds.RealLine()
C = E.curve((1/2^0.5*cos(t),1/2^0.5*sin(t),1/2^0.5*t), (s,-1.1*pi,1.1*pi), name='C')
T = C.tangent_vector_field()
T.display()
norm(T)
norm(T).display()
I = C.domain(); I
Tp = I.vector_field([diff(T[i],s) for i in E.irange()], dest_map=C, name="T'")
Tp.display()
kappa = norm(Tp)
kappa.expr()
N = Tp/kappa
N.display()
B = T.cross_product(N); B
FS = I.vector_frame(('T','N','B'), (T,N,B), symbol_dual=('t','n','b'))
matrix([[u.dot(v).expr() for v in FS] for u in FS])
T.at(R(pi)).display()
N.at(R(pi)).display()
B.at(R(pi)).display()
Following does not work...:
projectionToOsculating = [(C-C(0)).dot(T.at(R(0))), (C-C(0)).dot(N.at(R(0)))]
show(projectionToOsculating.plot(thickness=2, aspect_ratio=1))ykleeTue, 12 Sep 2023 02:25:56 +0200https://ask.sagemath.org/question/73358/how do i plot 3d planes like x=1https://ask.sagemath.org/question/26070/how-do-i-plot-3d-planes-like-x1/ I plotted z=x^2+y^2 and would like to add some planes to the diagram. How do i plot x=1?fredsmith999Sun, 08 Mar 2015 10:22:49 +0100https://ask.sagemath.org/question/26070/add a plane defined by two vectorshttps://ask.sagemath.org/question/10537/add-a-plane-defined-by-two-vectors/I have a set of three vectors
p1 = vector([1,-0.5,0]) # eigenvector of eigenvalue 2
p2 = vector([0,0,1]) # eigenvector of eigenvalue 2
c = vector([1,-1,0]) # eigenvector of eigenvalue 3
plot(p1, color = "red") + plot(p2, color = "red") + plot(c)
Vectors `p1` and `p2` form a plane since they come from the same eigenvalue. How would I add a plane defined by these two vectors?Roman LuĀtrikFri, 13 Sep 2013 16:30:40 +0200https://ask.sagemath.org/question/10537/Basic vector functions in Sagehttps://ask.sagemath.org/question/8924/basic-vector-functions-in-sage/Isn't there any inbuilt 3D vector functions in Sage?
For instance like a function to get the dot product, cross product or angle between two vectors? Or functions to get the distance from a point to a line? Find the intersections between two lines? Having such functions would be a great help and would greatly increase the speed of my workflow in school.paldepindWed, 25 Apr 2012 07:43:34 +0200https://ask.sagemath.org/question/8924/Unexpected behavior of log() in complex planehttps://ask.sagemath.org/question/8409/unexpected-behavior-of-log-in-complex-plane/For the log() to be defined properly in the complex plane we need to agree on where its cut is located. So, for sage it is easy to check that the cut is located on the negative Re-axis (as is most common), namely
sage: var('eps')
sage: limit(log(-1+i*eps),eps=0,dir='+')
I*pi
sage: limit(log(-1+i*eps),eps=0,dir='-')
-I*pi
Ok. Now I want to use this with symbolic variables. So I do
sage: var('w eps')
sage: forget()
sage: assume(w,'real')
sage: assume(w>0)
sage: limit(log(-w+i*eps),eps=0,dir='+')
I*pi + log(w)
sage: limit(log(-w+i*eps),eps=0,dir='-')
-I*pi + log(w)
Ok. That is correct. Now I want to get a little more adventurous, namely
sage: var('w ec eps')
sage: forget()
sage: assume(w,'real')
sage: assume(ec,'real')
sage: assume(eps,'real')
sage: assume(w>0)
sage: assume(w<ec)
sage: limit(log(w-ec+i*eps),eps=0,dir='+')
I*pi + log(-ec + w)
sage: limit(log(w-ec+i*eps),eps=0,dir='-')
-I*pi + log(-ec + w)
**Oops? This is wrong.** The argument of the log() has not been turned into the absolute value its real part, i.e. `ec-w`. This also contradicts the previous simpler startup examples.
Just for backup. Mathematica will give you
In[6]:= Limit[Log[w-ec+I eps],eps->0,Direction->-1,Assumptions->{w>0,w<ec}]
Out[6]= I Pi+Log[ec-w]
In[7]:= Limit[Log[w-ec+I eps],eps->0,Direction->1,Assumptions->{w>0,w<ec}]
Out[7]= -I Pi+Log[ec-w]
As I was expecting and at variance with sage's output.XaverSun, 23 Oct 2011 16:46:45 +0200https://ask.sagemath.org/question/8409/