Here are the basic functions: Sphere Cylinder
That said your best bet is probably using the matrix approach to size the geometry as @guido explains here for a similar question.