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},{1,1,1},{1,0,1}}; (*note all z=1 *)
b2D1={{0,1,1},{-1,1,1},{-1,0,1}}; (*note all z=1 *)
b2D2={{0,-1,1},{-1,-1,1},{-1,0,1}}; (*note all z=1 *)
b2D3={{0,-1,1},{1,-1,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}];
b3D1=Table[w[[i]]*b2D1[[i]], {i,1,3}];
b3D2=Table[w[[i]]*b2D2[[i]], {i,1,3}];
b3D3=Table[w[[i]]*b2D3[[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}];
b3D1=Table[w[[i]]*b2D1[[i]], {i,1,3}];
b3D2=Table[w[[i]]*b2D2[[i]], {i,1,3}];
b3D3=Table[w[[i]]*b2D3[[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]}];
curve3D=ParametricPlot3D[dca[b3D,2,0,t],{t,0,1},PlotStyle->{Thick,Green},PlotRange->2];
cone=ParametricPlot3D[ v* dca[b3D,2,0,u]/dca[{1,w1,1},2,0,u],{u,0,1},{v,0,1.8},PlotStyle->{Opacity[0.8],Specularity[White,20]},Mesh->False];

curve2D1=ParametricPlot3D[dca[b3D1,2,0,t]/dca[{1,w1,1},2,0,t],{t,0,1},PlotStyle->{Thick, If[Abs[w1-wcirc]<0.05,White,Red]}];
curve3D1=ParametricPlot3D[dca[b3D1,2,0,t],{t,0,1},PlotStyle->{Thick,Green},PlotRange->2];
cone1=ParametricPlot3D[ v* dca[b3D1,2,0,u]/dca[{1,w1,1},2,0,u],{u,0,1},{v,0,1.8},PlotStyle->{Opacity[0.8],Specularity[White,20]},Mesh->False];

curve2D2=ParametricPlot3D[dca[b3D2,2,0,t]/dca[{1,w1,1},2,0,t],{t,0,1},PlotStyle->{Thick, If[Abs[w1-wcirc]<0.05,White,Red]}];
curve3D2=ParametricPlot3D[dca[b3D2,2,0,t],{t,0,1},PlotStyle->{Thick,Green},PlotRange->2];
cone2=ParametricPlot3D[ v* dca[b3D2,2,0,u]/dca[{1,w1,1},2,0,u],{u,0,1},{v,0,1.8},PlotStyle->{Opacity[0.8],Specularity[White,20]},Mesh->False];

curve2D3=ParametricPlot3D[dca[b3D3,2,0,t]/dca[{1,w1,1},2,0,t],{t,0,1},PlotStyle->{Thick, If[Abs[w1-wcirc]<0.05,White,Red]}];
parabola3=ParametricPlot3D[dca[b3D3,2,0,t],{t,0,1},PlotStyle->{Thick,Green},PlotRange->2];
cone3=ParametricPlot3D[ v* dca[b3D3,2,0,u]/dca[{1,w1,1},2,0,u],{u,0,1},{v,0,1.8},PlotStyle->{Opacity[0.8],Specularity[White,20]},Mesh->False];

planez1=Graphics3D[{Opacity[0.5],Black,Polygon[{{1.5,1.5,1},{-1.5,1.5,1},{-1.5,-1.5,1},{1.5,-1.5,1}} ]}]; (* Plane z=1, gray *)
Show[{planez1,curve2D,curve3D,cone,origin,curve2D1,curve3D1,cone1,curve2D2,curve3D2,cone2,curve2D3,parabola3,cone3},Boxed->False,ViewPoint->{8000,-4000,6000}], {{w1,1.5},0,3}
]
(* the large numbers for ViewPoint make the display nearly orthographic. *)