Ask Your Question
3

Get a 3d plot with points (no surface) from a parametric_plot3d?

asked 2014-02-06 03:31:16 +0100

openscript gravatar image

updated 2015-10-20 21:39:13 +0100

FrédéricC gravatar image

I would like to plot only points in a defined resolution, which I get from a parametric_plot3d().

Here is my Sage code:

var('u,v')
a(u,v)=-7*sin(((u-100)/(100))*pi)^2+0.2*sin(((3*u-300)/(10))*pi)
b(u,v)=-8*cos(((u-100)/(100))*pi)+0.2*cos(((3*u-300)/(10))*pi)
c(u,v)=-12*cos(((u-100)/(100))*pi)+15*sin(((v-20)/(40))*pi)
def x(u,v):
    if u < 100:
        return 7*sin((u/100)*pi)^2+0.15*sin((3*u/10)*pi)
    else:
        return a(u,v)
def y(u,v):
    if u < 100:
        return 8*cos((u/100)*pi)+0.15*cos((3*u/10)*pi)
    else:
        return b(u,v)
def z(u,v):
    if u < 100:
        return 12*cos((u/100)*pi)+15*sin(((v-20)/40)*pi)
    else:
        return c(u,v)
p = parametric_plot3d([x,y,z], (u, 0, 200), (v, 0, 40), frame=False)

I'm looking for a result, which is similar to: image description So I don't need a real surface, only the points.

How can I achieve this?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
4

answered 2014-02-06 06:13:40 +0100

ppurka gravatar image

You can use the points function to do so. The only difference is that you will have to sample the function yourself. Here I am sampling it at [40, 40] points which is the default for parametric plot.

sage: pointlist = [(x(u,v), y(u,v), z(u,v)) for u in xrange(0, 200, 5) for v in xrange(40)]
sage: points(pointlist)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-02-06 03:31:16 +0100

Seen: 619 times

Last updated: Feb 06 '14