Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Search  

/home/mrm/Simex/simulations/hr_bike/pv_point.h File Reference

#include <iostream>
#include <cmath>

Include dependency graph for pv_point.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

class  Pv_Point

Functions

std::ostream & operator<< (std::ostream &s, const Pv_Point &z)
double length (Pv_Point the_point)
Pv_Point operator * (double f, Pv_Point p)
Pv_Point normalize (Pv_Point p)
Pv_Point perpendicular (Pv_Point p)
Pv_Point operator- (Pv_Point p)


Function Documentation

std::ostream& operator<< std::ostream &    s,
const Pv_Point   z
 

00132                                             {
00133   return s<<"Pv_Point: ("
00134           <<z.get_x() 
00135           << ","
00136           <<z.get_y()
00137           <<","
00138           <<z.get_z()
00139           <<"):\n";
00140 }

double length Pv_Point    the_point
 

00143                           {
00144   double a=the_point.get_x();
00145   double b=the_point.get_y();
00146   double c=the_point.get_z();
00147   return(sqrt(pow(a,2)+pow(b,2)+pow(c,2)));
00148 }

Pv_Point operator * double    f,
Pv_Point    p
 

00165                                        {
00166   return(Pv_Point(f*p.get_x(),
00167                   f*p.get_y(),
00168                   f*p.get_z()));
00169 }

Pv_Point normalize Pv_Point    p
 

00172                      {
00173   double d=length(p);
00174   assert(d!=0);
00175   return(Pv_Point(p.get_x()/d,
00176                   p.get_y()/d,
00177                   p.get_z()/d));
00178 }

Pv_Point perpendicular Pv_Point    p
 

00181                          {
00182   assert(length(p)!=0);
00183   if(p.get_x()!=0){
00184     return(Pv_Point(-p.get_y(),
00185                     p.get_x(),
00186                     0));
00187   }
00188   else{
00189     return(Pv_Point(0,
00190                     -p.get_z(),
00191                     p.get_y()));
00192   }
00193 }

Pv_Point operator- Pv_Point    p
 

00158                       {
00159   return(Pv_Point(-p.get_x(),
00160                   -p.get_y(),
00161                   -p.get_z()));
00162 }


Generated on Sat Jul 19 04:03:15 2003 for SIMEX by doxygen1.2.18