CSE 477 / G. Farin
Conics

Conics may be represented as rational quadratic Bezier curves. This notebook shows how the wight, w1, infuences the shape of the conic.

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]];

b={{-1,1},{0,0},{1,1}};
w1=1.5; (* hyperbola*)
(* w1= 0.5 (* ellipse *) *)
w={1.0,w1,1.0};

rb=Table[w[[i]]*b[[i]], {i,1,3}];

Plotting the weight function w (t)

Plot[dca[w,2,0,t],{t,-1,2},PlotStyle->{Thick, Gray},AxesOrigin-> {0,0}]

Plotting the conic

curve=ParametricPlot[dca[rb,2,0,t]/dca[{1,w1,1},2,0,t],{t,0,1},PlotStyle->{Thick, Green},PlotRange->2];
poly=Graphics[{Thick,Line[b]}];
points=Graphics[{PointSize[Large],Red,Point[b]}];
Show[{points,curve,poly}]

Visualizing the curve parametrization

cpoints=Graphics[{Thick,Green,PointSize[Large],Point[Table[dca[rb,2,0,t]/dca[{1,w1,1},2,0,t],{t,0,1,0.03}]],PlotRange->3}];
Show[points,poly,cpoints]

Effect of the weight w1

Manipulate[
curve=ParametricPlot[dca[{b[[1]],w1*b[[2]],b[[3]]},2,0,t]/dca[{1,w1,1},2,0,t],{t,0,1},PlotStyle->{Thick, Green},PlotRange->2];

poly=Graphics[{Thick,Line[b]}];
points=Graphics[{PointSize[Large],Red,Point[b]}];
Show[{points,poly,curve}],{{w1,1},-1,5}]

Motion along rays

Manipulate[
curve=ParametricPlot[dca[{b[[1]],w1*b[[2]],b[[3]]},2,0,t]/dca[{1,w1,1},2,0,t],{t,0,1},PlotStyle->{Thick, Green},PlotRange->2];
crays=Graphics[{Gray,Line[Table[{dca[rb,2,0,t]/dca[{1,w1,1},2,0,t],  b[[2]] },{t,0,1,0.03}]],PlotRange->3}];

poly=Graphics[{Thick,Line[b]}];
points=Graphics[{PointSize[Large],Red,Point[b]}];
Show[{points,poly,curve,crays}],{{w1,1},-1,5}]