3_PowerRadiated/measuredPowerLienardWiechert/measuredPowerLienardWiechert.c
//calculate unit vector from existing vector
calculate unit vector from existing vector
calculate unit vector from existing vector
void calculateUnitVec(double *vec, double *unitVec) {
  double magnitude = sqrt(pow(vec[0],2.0) + pow(vec[1],2.0) + pow(vec[2],2.0));
  unitVec[0] = vec[0]/magnitude;
  unitVec[1] = vec[1]/magnitude;
  unitVec[2] = vec[2]/magnitude;
}
void calculateUnitVec ( double * vec , double * unitVec ) { double magnitude = sqrt ( pow ( vec [ 0 ] , 2.0 ) + pow ( vec [ 1 ] , 2.0 ) + pow ( vec [ 2 ] , 2.0 ) ) ; unitVec [ 0 ] = vec [ 0 ] / magnitude ; unitVec [ 1 ] = vec [ 1 ] / magnitude ; unitVec [ 2 ] = vec [ 2 ] / magnitude ; }
calculate unit vector from existing vector
calculate unit vector from existing vector