Changeset 568 in Sophya for trunk/SophyaLib/Samba/circle.cc


Ignore:
Timestamp:
Nov 10, 1999, 3:17:10 PM (26 years ago)
Author:
ansari
Message:

ajout doc GLM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/circle.cc

    r470 r568  
    11#include <math.h>
    22#include "circle.h"
    3 
     3//++
     4// Class        Circle
     5//
     6// include      circle.h math.h
     7//--
     8//++
     9//
     10// Links        Parents
     11//
     12//    Geometry
     13//   
     14//--
     15//++
     16// Titre        Constructors
     17//--
     18//++
    419Circle::Circle()
     20//
     21//--
    522{
    623  UnitVector temp;
    724  SetCircle(temp,M_PI/2.);
    825}
    9 
     26//++
    1027Circle::Circle(double theta, double phi, double aperture)
     28//
     29//--
    1130{
    1231  UnitVector temp(theta,phi);
    1332  SetCircle(temp,aperture);
    1433}
    15 
     34//++
    1635Circle::Circle(double x, double y, double z, double aperture)
     36//
     37//--
    1738{
    1839  UnitVector temp(x,y,z);
    1940  SetCircle(temp,aperture);
    2041}
    21 
     42//++
    2243Circle::Circle(const Vector3d& v, double aperture)
     44//
     45//--
    2346{
    2447  UnitVector temp=v;
    2548  SetCircle(temp,aperture);
    2649}
    27 
     50//++
    2851Circle::Circle(const Circle& c)
     52//
     53//    copy constructor
     54//--
    2955{
    3056  UnitVector temp=c.Omega();
    3157  SetCircle(temp,c._angouv);
    3258}
    33 
     59//++
     60// Titre        Public Methods
     61//--
     62//++
    3463void Circle::SetCircle(const UnitVector& temp, double aperture)
     64//
     65//--
    3566{
    3667  _spinunitaxis=temp;
     
    4374  _z=_spinunitaxis.Z();
    4475}
    45 
     76//++
    4677void Circle::SetSpinAxis(double theta, double phi)
     78//
     79//--
    4780{
    4881  UnitVector temp(theta,phi);
    4982  SetCircle(temp,_angouv);
    5083}
    51 
     84//++
    5285void Circle::SetSpinAxis(const Vector3d& u)
     86//
     87//--
    5388{
    5489  UnitVector temp=u;
    5590  SetCircle(temp,_angouv);
    5691}
    57 
     92//++
    5893void Circle::SetSpinAxis(double x, double y, double z)
     94//
     95//--
    5996{
    6097  UnitVector temp(x,y,z);
    6198  SetCircle(temp,_angouv);
    6299}
    63 
     100//++
    64101void Circle::SetApertureAngle(double aperture)
     102//
     103//--
    65104{
    66105  SetCircle(_spinunitaxis,aperture);
    67106}
    68 
     107//++
    69108void Circle::SetApertureAngle(const Circle& c)
     109//
     110//--
    70111{
    71112  SetCircle(_spinunitaxis,c._angouv);
    72113}
    73 
     114//++
    74115bool Circle::Intersection(const Circle& c, double* psi) const
     116//
     117//    psi contains  4 values of the intersection  angles.
     118//    -1 if  circles do not intersect
     119//    psi[0]=psi(i,j,0)
     120//    psi[1]=psi(i,j,1)
     121//    psi[2]=psi(j,i,0)
     122//    psi[3]=psi(j,i,1)
     123//--
    75124{
    76125  double alphak=_angouv;
     
    119168    }
    120169}
    121 
     170//++
    122171UnitVector Circle::ConvToSphere(double psi) const
     172//
     173//    Return UnitVector corresponding to a given position donnee on the circle
     174//--
    123175{
    124176  psi=mod(psi,pi2);
     
    137189  return UnitVector(xout,yout,zout);
    138190}
    139 
     191//++
    140192UnitVector Circle::TanOnCircle(double psi) const
     193//
     194//    Return UnitVector corresponding to the tangent to the circle
     195//    at given position on the circle.
     196//--
    141197{
    142198  psi=mod(psi,pi2);
     
    153209  return UnitVector(xout,yout,zout);
    154210}
    155 
     211//++
    156212UnitVector Circle::EPhi(double psi) const
     213//
     214//    Return the  vector  tangent to the sphere in the plane (xy)
     215//    at a given position on the circle.
     216//--
    157217{
    158218  psi=mod(psi,pi2);
    159219  return ConvToSphere(psi).EPhi();
    160220}
    161 
     221//++
    162222UnitVector Circle::ETheta(double psi) const
     223//
     224//    Return the other tangent  vector( orthogonal to EPhi)--
     225//    see previous method
     226//--
    163227{
    164228  psi=mod(psi,pi2);
    165229  return ConvToSphere(psi).ETheta();
    166230}
    167 
     231//++
    168232double Circle::SepAngleTanEPhi02PI(double psi) const
     233//
     234//    Return separation angle in [0,2Pi] at a given position on the
     235//    circle and EPhi
     236//--
    169237{
    170238  psi=mod(psi,pi2);
     
    175243  return angle;
    176244}
     245//++
     246void Circle::Print(ostream& os) const
     247//
     248//--
     249{
     250  os << "1 - Circle - Axe de Spin Unitaire : " << _spinunitaxis << endl;
     251  os << "1 - Circle - Axe de Spin : " << _spinaxis << endl;
     252  os << "2 - Circle - Angle d'ouverture : " << _angouv << endl;
     253  os << "3 - Circle - Theta,Phi : " << _theta << "," << _phi << endl;
     254  os << "4 - Circle - x,y,z : " << _x << "," << _y << "," << _z << endl;
     255}
     256//++
     257//
     258// inline double Theta() const
     259// inline double Phi() const
     260// inline double ApertureAngle() const
     261// inline Vector3d Omega() const
     262//--
     263//++
     264// Titre        Operators
     265//--
    177266
    178267Circle& Circle::operator=(const Circle& c)
     
    185274  return *this;
    186275}
    187 
     276//++
    188277bool Circle::operator==(const Circle& c) const
     278//
     279//--
    189280{
    190281  bool flag;
     
    193284  return flag;
    194285}
    195 
     286//++
    196287bool Circle::operator!=(const Circle& c) const
     288//
     289//--
    197290{
    198291  return (bool)(1-(this->operator==(c)));
    199292}
    200 
    201 void Circle::Print(ostream& os) const
    202 {
    203   os << "1 - Circle - Axe de Spin Unitaire : " << _spinunitaxis << endl;
    204   os << "1 - Circle - Axe de Spin : " << _spinaxis << endl;
    205   os << "2 - Circle - Angle d'ouverture : " << _angouv << endl;
    206   os << "3 - Circle - Theta,Phi : " << _theta << "," << _phi << endl;
    207   os << "4 - Circle - x,y,z : " << _x << "," << _y << "," << _z << endl;
    208 }
Note: See TracChangeset for help on using the changeset viewer.