<< Click to Display Table of Contents >> 3d_ellipsoid |
{ 3D_ELLIPSOID.PDE
This problem constructs an ellipsoid.
It is the geometric construction only, there are no variables or equations.
}
title '3D Ellipsoid'
coordinates cartesian3
definitions
a=3 b=2 c=1 { x,y,z radii }
xc=1 yc=1 zc=1 { coordinates of ellipsoid center }
{ top half of ellipsoid surface :
the MAX function is used to ensure the surface is defined throughout all
x,y space - essentially placing an x=0 'skirt' on the ellipsoid surface }
ellipsoid = c*sqrt( max(0,1-(x-xc)^2/a^2-(y-yc)^2/b^2) )
extrusion
surface 'bottom' z = zc - ellipsoid
surface 'top' z = zc + ellipsoid
boundaries
region 'ellipse'
start(xc+a,yc)
arc(center=xc,yc) to (xc,yc+b) to (xc-a,yc) to (xc,yc-b) to close
plots
grid(x,y,z)
grid(x,y) on z=zc
grid(y,z) on x=xc
grid(x,z) on y=yc
end