/***************************************************************************
 *   Copyright (C) 2006 by Harish Kukreja                                  *
 *   harish.kukreja@gmail.com                                              *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

//
// C++ Interface: computations
//
// Description: Headers for miscellaneous computation functions used in Physiks. Also includes
//              prototypes for functions that modify the states of PhysicalObjects according to
//              fields.
//
// Author: Harish Kukreja <harish.kukreja@gmail.com>, (C) 2006
//
// Copyright: See COPYING file that comes with this distribution
//
//


#ifndef _COMPUTATIONS_H_
#define _COMPUTATIONS_H_

#include "globaldefs.h"
#include "physiksvector.h"

namespace Physiks {

  class PhysicalObject;

  namespace Computation {

    /** \brief Computes the distance between two physical objects in Cartesian-Euclidean space.
     * @param a object a
     * @param b object b
     * @return the scalar distance between a and b */
    PHYSCALAR distance(const PhysicalObject &a, const PhysicalObject &b);

    Vector connecting_vector(const PhysicalObject &a, const PhysicalObject &b);

    /** \brief Computes the Newtonian gravitational force between two objects.
     * @return the magnitude of the gravitational force between obj1 and obj2 */
    PHYSCALAR gravitational_force(const PhysicalObject &obj1, const PhysicalObject &obj2);

    Vector gravitational_force_vector(const PhysicalObject &obj1, const PhysicalObject &obj2);

    /** \brief Calculates the signed magnitude of the coulomb force between two charges.
     * @param a Object a
     * @param b Object b
     * @return the signed magnitude of the Coulomb force between charges a & b */
    PHYSCALAR coulomb_force(const PhysicalObject &obj1, const PhysicalObject &obj2);

    Vector coulomb_force_vector(const PhysicalObject &obj1, const PhysicalObject &obj2);

  } // End of namespace Computation
} // End of namespace Physiks

#endif
