/*=========================================================================

  Program:   Orbit Visualization Tool
  Source:    $Source: /stor/devel/ovt2g/ovt/model/bowshock/Bowshock99Model.java,v $
  Date:      $Date: 2001/03/24 12:27:31 $
  Version:   $Revision: 1.1 $


=========================================================================*/

// Created 5 Apr 2000 11:44 UTC by kono
package ovt.model.bowshock;
import java.lang.Math;

public class Bowshock99Model {

  /** [swp]=nPa, [teta]=radians, smn - solar mag. number, normal: smn=5.4
   * @param cosTheta cosine of Theta angle
   * @param swp Solar Wind Pressure [nPa]
   * @param machNumber Solar Mag Number
   * @return distance to bow shock
   */
   public static double getR(double cosTheta, double swp, double machNumber) {
      final double e=0.8,r,smn2=machNumber*machNumber;
      double k=19.0*Math.pow(1.8/swp,0.1666666666666);
      
      k*=(1.0+1.1*(smn2+3.0)/(4.0*smn2));
      r=k/(1.0+e*cosTheta);
      return r;
   }
   
/*   //rotating in GSE on 3.8 degs around Z axis
   public double[] rotatedBS(double swp,double[] inXYZ){
      double[] outXYZ=new double[3];
      double teta,r,vabs1;
      
      teta=Math.atan2(inXYZ[1],inXYZ[0]);
      r=getR(teta,swp);
      for(int i=0;i<3;++i)
         outXYZ[i]=inXYZ*r/;
      return outXYZ;
   }*/
}
