/*
 * ForceField.java
 *
 * Created on 14 styczeń 2005, 00:58
 */

package JSciDraw.physics.fields;

import JSci.maths.*;
import JSci.physics.*;
import JSciDraw.interfaces.*;
import JSciDraw.physics.*;
import java.util.*;
/*
 *
 * @author  Barbara
 */
public class ConstantGravityField extends ForceField{
    /** Creates a new instance of ForceField */
    private class CForce extends ProdForce 
    {
        public CForce(ClassicalParticleV2D p){
           super(p);
       }
       public AbstractDoubleVector getVector(double t) {
         return vectors[0].scalarMultiply(p.getMass());
       }
       
    }

    public ConstantGravityField(AbstractDoubleVector fieldVect) {
          vectors = new AbstractDoubleVector[1];
          vectors[0]=fieldVect;
    }
    public ProdForce getForce(ClassicalParticleV2D p){
        return new CForce(p);
    }
   
}
