r := [x,y,z]: u := vector(3): v := vector(3): alias(dot=innerprod, cp=crossprod); w := cp( r-u, v ): Cyl := dot(w,w) - dot(v,v)*R^2; Cyl := collect( Cyl, [x,y,z], distributed ); Cyl := proc(r,u,v,R) local x,y,z,w,eq; x := r[1]; y := r[2]; z := r[3]; w := crossprod( r-u,v ); eq := dotprod(w,w) - dotprod(v,v)*R^2: eq := collect(simplify(eq),[x,y,z],distributed); end: Cyl([x,y,z],[0,0,0],[1,0,0],1); Cyl([x,y,z],[1,0,0],[0,0,1],R); assume(x, real): Cyl([x,y,z],[1,0,0],[0,0,1],R);