.. oe:namespace:: OEMath



.. meta::
   :keywords: OESphere, SphereBase


.. _OEMath_OESphere:

.. oe:class:: OESphere

   .. oe:api::OESphere

      class OESphere

   :ref:`OESphere <OEMath_OESphere>` class represents a sphere.

   .. oe:method:: Constructor
      
      .. oe:language:: c++ java csharp

         .. oe:api::

            OESphere()
            OESphere& operator=(const OESphere&)
            OESphere(const float x, const float y, const float z,
                     const float rad)

      .. oe:language:: python

         .. oe:api:: python

            OESphere() -> OESphere
            OESphere(x: float, y: float, z: float, rad: float) -> OESphere
            OESphere(arg2: OESphere) -> OESphere


   Default and copy constructors.  The third overload requires the center of the
   sphere, specified by `x, y, and z`, and the radius.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OESphere& operator=(const OESphere& rhs)

   Assignment operator.

   .. oe:method:: GetArea
        
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetArea() const

      .. oe:language:: python

         .. oe:api:: python

            GetArea() -> float

      Returns the surface area of the sphere

   .. oe:method:: GetVolume
        
      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetVolume() const

      .. oe:language:: python

         .. oe:api:: python

            GetVolume() -> float

      Returns the volume of the sphere

   .. oe:method:: GetX

      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetX() const

      .. oe:language:: python

         .. oe:api:: python

            GetX() -> float

      Returns the X coordinate of the center of the sphere

   .. oe:method:: GetY

      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetY() const

      .. oe:language:: python

         .. oe:api:: python

            GetY() -> float

      Returns the Y coordinate of the center of the sphere

   .. oe:method:: GetZ

      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetZ() const

      .. oe:language:: python

         .. oe:api:: python

            GetZ() -> float

      Return the Z coordinate of the center of the sphere

   .. oe:method:: GetRad

      .. oe:language:: c++ java csharp

         .. oe:api::

            float GetRad() const

      .. oe:language:: python

         .. oe:api:: python

            GetRad() -> float

      Returns the radius of the sphere

   .. oe:method:: IsInside
         
      .. oe:language:: c++ java csharp

         .. oe:api::

            bool IsInside(const float x, const float y, const float z) const

      .. oe:language:: python

         .. oe:api:: python

            IsInside(x: float, y: float, z: float) -> bool

      Returns if the specified point is inside the sphere

   .. oe:method:: SetRad

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool SetRad(const float rad)

      .. oe:language:: python

         .. oe:api:: python

            SetRad(rad: float) -> bool

      Sets the radius of the sphere to *rad*.  Will
      fail and return false if *rad* < 0.

   .. oe:method:: SetCenter

      .. oe:language:: c++ java csharp

         .. oe:api::

            bool SetCenter(const float x, const float y, const float z)

      .. oe:language:: python

         .. oe:api:: python

            SetCenter(x: float, y: float, z: float) -> bool

      Sets the center of the sphere.

