Ask Your 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.

edit retag close merge delete

## 1 Answer

Sort by » oldest newest most voted

You can introduce a new parameter s that will parametrize the line. With p=(-e^pi,0,e^pi), the line is then p+s*tvec(t=t0) for some fixed value t0 of the parameter t.

Then, the line can be drawn as follows.

var('s,t')
p=vector([-exp(pi),0,exp(pi)])
tvec = vector((e^t * cos(t) - e^t * sin(t), e^t * sin(t) + e^t * cos(t), e^t))
parametric_plot3d(p+s*tvec(t=pi/2),(s,0,5),thickness=3)

more

## Your Answer

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

Add Answer

## Stats

Asked: 2012-05-26 11:51:13 +0200

Seen: 976 times

Last updated: May 26 '12