Пример #1
0
AxialBox EncloseABox ( Cylinder const & C )
{
	Vector center = C.getCenter();

	Vector extent( C.getExtentX(), C.getExtentY(), C.getExtentZ() );

	return AxialBox(center-extent,center+extent);
}
Пример #2
0
Sphere EncloseSphere ( Cylinder const & shape )
{
	float x = shape.getExtentX();
	float y = shape.getExtentY();

    float radius = sqrt( x*x + y*y );

    return Sphere( shape.getCenter(), radius );
}