Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Funny ellipse

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