Ask Your Question

dnizetic's profile - activity

2017-05-07 11:06:44 -0500 received badge  Notable Question (source)
2017-03-02 19:03:23 -0500 received badge  Famous Question (source)
2017-01-08 05:09:07 -0500 received badge  Notable Question (source)
2015-10-27 13:11:55 -0500 received badge  Popular Question (source)
2015-03-06 15:46:40 -0500 received badge  Notable Question (source)
2013-11-22 20:37:58 -0500 received badge  Popular Question (source)
2013-10-08 02:10:02 -0500 received badge  Popular Question (source)
2013-09-29 09:16:44 -0500 received badge  Popular Question (source)
2012-05-27 20:36:57 -0500 asked a question Variable not found

Hi, why does this snippet produces "variable 'a' not found"?

I looked all over and I just can't figure it out.

var('a');
var('x y z');
x = cos(a)^3;
y = sin(a)^3;
z = cos(2*a);

pl1=parametric_plot3d( (cos(t)^3, sin(t)^3, cos(2*t)), (t, 0, 2*pi));

a = pi/4;
pl2=parametric_plot3d( (x + t*(derivative(x)), y + t * (derivative(y)), z + t * (derivative(z))), (t,0,1), texture="red");
2012-05-27 20:35:36 -0500 marked best answer How to decrease the iteration step from 1 to 0.1?

Here's one approach, which works by giving Sage enough values that it can guess what step you want:

sage: (0.1, 0.2, .., 0.5)
<generator object ellipsis_iter at 0x11bce0fa0>
sage: list(0.1, 0.2, .., 0.5)
[0.100000000000000, 0.200000000000000, 0.300000000000000, 0.400000000000000, 0.500000000000000]
2012-05-27 13:43:01 -0500 asked a question How to decrease the iteration step from 1 to 0.1?
@interact
def _(a=((0.1)..(5.00))):
  ...
  show(pl1+pl2+pl3+pl4);

I would like 'a' to be iterated by the step 0.1, and not 1.

How can I achieve this?

2012-05-26 04:51:13 -0500 asked a question Given a direction vector and a point, how to draw a 3d line?

I have a point

(-e^pi, 0, e^pi)

and a direction vector

tvec = vector((e^t * cos(t) - e^t * sin(t), e^t * sin(t) + e^t * cos(t), e^t))

How would I draw a 3d line based upon these 2 arguments?

I looked over at the documentation but I couldnt find it.

2012-05-21 06:56:19 -0500 asked a question Let user move a frenet trihedron along a curve?

How to "animate" a frenet trihedron along a given curve?

I believe this is similar to what I'm looking for:

http://www.math.byu.edu/~math302/cont...

but in the context of curves, because my task is to draw this curve:

c2: [0, 5] -> R^3, c2(t) = (e^t * cos(t), e^t * sin(t), e^t)

and give the user ability to move a frenet trihedron along that curve (using a parameter and @interact)

I know how to draw a curve and basics of interact:

show(parametric_plot3d( (e^t * cos(t), e^t * sin(t), e^t), (t, 0, 2*pi)));
@interact
...

But I don't have enough knowledge about frenet trihedron. If anyone could help me out I would appreciate it.

2012-04-07 06:18:22 -0500 marked best answer How to orthogonaly project a 3d plot to coordinate planes?

Is this what you mean? We can just "slice" the vector here to get the coordinate pieces.

sage: var('t')
t
sage: V = vector((cos(t)^3, sin(t)^3, cos(2*t)))
sage: parametric_plot3d(V,(t,0,2*pi))
sage: parametric_plot(V[:2],(t,0,2*pi))
sage: parametric_plot(V[1:],(t,0,2*pi))
sage: parametric_plot(vector((V[0],V[2])),(t,0,2*pi))

Naturally, orthogonal projection to some random plane would be more involved (though basically you could use the vector projection, I guess), but maybe you don't need that much firepower.

2012-04-07 06:18:22 -0500 received badge  Scholar (source)
2012-04-07 06:18:18 -0500 received badge  Supporter (source)
2012-04-06 10:44:31 -0500 received badge  Student (source)
2012-04-06 06:18:11 -0500 received badge  Editor (source)
2012-04-06 05:54:47 -0500 asked a question How to orthogonaly project a 3d plot to coordinate planes?

Hi, I created a 3d plot with

parametric_plot3d( (cos(t)^3, sin(t)^3, cos(2*t)), (t, 0, 2*pi))

I looked over at google for some projection() functions but I didn't find much.

Basically what I need to do is orthogonally project that plot onto coordinate planes (x, y, z).

If anyone has any idea or an approximate algorithm, that would be nice.

Edit: is it possible that this is an orthogonal projection to coordinate planes? I'm showing 3 plots, first has z = 0, second has x = 0 and third has y = 0.

show( parametric_plot3d((cos(t)^3, sin(t)^3, 0), (t, 0, 2*pi)) + parametric_plot3d( (0, sin(t)^3, cos(2*t)), (t, 0, 2*pi)) + parametric_plot3d( (cos(t)^3, 0, cos(2*t)), (t, 0, 2*pi)));