Ask Your Question
0

Funny ellipse

asked 2016-05-19 05:31:21 +0100

TumericTJ gravatar image

I am trying to plot an ellipse (using the term loosely). I want the set of points equidistant from the plane defined parametrically by (0, 0, 1) + t(0, 1, 1) + s(1, 1, 1). It is intuitive that this is just the union of two parallel planes. But when I plot, I get an oval...what is wrong? Note that uncommenting to change the vectors gives two planes as expected, furthering my bewilderment.

posvec  = vector([0, 0, 1])
# posvec  = vector([1, 1, 1])
dirvec1 = vector([1, 1, 0])
# dirvec1 = vector([-1, 2, 0])
dirvec1 = dirvec1 / dirvec1.norm()
dirvec2 = vector([1, 1, 1]) 
# dirvec2 = vector([3, 0, -7])
dirvec2 = dirvec2 / dirvec2.norm()

point  = vector([x, y, z])
relpos = point - posvec
disvec = relpos - relpos.dot_product(dirvec1) * dirvec1 - relpos.dot_product(dirvec2) * dirvec2
dis    = disvec.norm()

radius = 10
my_ellipse = implicit_plot3d(10 - dis, (x, -15, 15), (y, -15, 15), (z, -15, 15), opacity = 0.3)
s, t = var('s, t')
my_focus   = parametric_plot3d(posvec + t * dirvec1 + s * dirvec2, (t, -15, 15), (s, -15, 15), opacity = 0.3, color = 'red')

my_pic = my_focus + my_ellipse
my_pic
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-05-19 15:07:19 +0100

kcrisman gravatar image

This interact may help you discover when the behaviors switch, which might help you diagnose it: http://sagecell.sagemath.org/?q=kmkqmk

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: 2016-05-19 05:31:21 +0100

Seen: 1,128 times

Last updated: May 19 '16