CSE 477 / G. Farin
Rational quadratics as projections of 3D parabolas

Conics may be represented as rational quadratic Bezier curves. This notebook shows how the weight w1 infuences the shape of the conic. We start with a cone, define by the green 3D parabola and the origin (and extended in the +z-direction). By changine the middle control points, we get different cones. All intersect the z=1 plane in a red curve, the conic section defined as a rational quadratic. If the middle green point is above the (gray) plane z=1, we get a 2D hyperbola. If it is below, we get a 2D ellipse. For the case of a circle, the 2D curve is drawn in white.

dca[b_,r_,i_,t_]:=If [r==0,b[[i+1]],(1-t)*dca[b,r-1,i,t]+t*dca[b,r-1,i+1,t]];

b2D={{0,1,1},{-0.2,-0.2,1},{1,0,1}}; (*note all z=1 *)
w1=0.5; 
wcirc=(b2D[[2]]-b2D[[1]]).(b2D[[3]]-b2D[[1]])/(Norm[b2D[[2]]-b2D[[1]]]
*Norm[b2D[[3]]-b2D[[1]]]); (* w1 for a circle, for a check below. For this to be valid, the 2D polygon has to form an isoceles triangle which is not checked here.*)
w={1.0,w1,1.0};

b3D=Table[w[[i]]*b2D[[i]], {i,1,3}];

Effect of the weight w1

Manipulate[ (* 2D projection (in z=1): Red, 3D: Green *)
w={1.0,w1,1.0};
b3D=Table[w[[i]]*b2D[[i]], {i,1,3}];
origin= Graphics3D[{PointSize[Large],Black,Point[{0,0,0}]}];
curve2D=ParametricPlot3D[dca[b3D,2,0,t]/dca[{1,w1,1},2,0,t],{t,0,1},PlotStyle->{Thick, If[Abs[w1-wcirc]<0.05,White,Red]}];
poly2D=Graphics3D[{Thick,Red,Line[b2D]}];
points2D=Graphics3D[{PointSize[Large],Red,Point[b2D]}];
curve3D=ParametricPlot3D[dca[b3D,2,0,t],{t,0,1},PlotStyle->{Thick,Green},PlotRange->2];
poly3D=Graphics3D[{Thick,Green,Line[b3D]}];
points3D=Graphics3D[{PointSize[Large],Green,Point[b3D]}];

cone=ParametricPlot3D[(1-v)*{0,0,0}+ v* dca[b3D,2,0,u]/dca[{1,w1,1},2,0,u],{u,0,1},{v,0,1.8},PlotStyle->Opacity[0.5],Mesh->False];
line3D=Graphics3D[Line[{{0,0,0},If[w1>1,b3D[[2]],b2D[[2]]]}]];
planez1=Graphics3D[{Opacity[0.5],Black,Polygon[{{-.2,-.2,1},{1.2,-.2,1},{1.2,1.2,1},{-.2,1.2,1}} ]}]; (* Plane z=1, gray *)
Show[{points3D,curve2D,poly2D,points2D,curve3D,poly3D,planez1,cone,origin,line3D},Boxed->False,ViewPoint->{8000,-4000,6000}], {{w1,1.5},0,3}]
(* the large numbers for ViewPoint make the display nearly orthographic. *)