%% Create and Visualize Sphere Collision Geometry
% Create a sphere collision geometry centered at the origin. The sphere has a radius of 1 meter.

rad = 1;
sph = collisionSphere(rad)

%
% Visualize the sphere.

show(sph)
title('Sphere')

%
% Create a cylinder collision geometry of radius 1 meter and length 3 meters.

cyl = collisionCylinder(1,3);

%
% Create a homogeneous transformation that corresponds to a translation of 2.5 meters up the z-axis. Set the pose of the sphere to the matrix. Show the sphere and the cylinder.

mat = trvec2tform([0 0 2.5]);
sph.Pose = mat;
show(sph)
hold on
show(cyl)
view(90,0)
zlim([-2 4])

%
% Copyright 2019 The MathWorks, Inc.