Changeset 3230 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/18/04 16:40:01 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3229 r3230  
    99    * mgui/MHexagon.cc
    1010      - added comment explaining the algorithm.
    11 
     11      - changed explicit values of Sin and Cos 60 degrees by const
     12        variables (more readable).
    1213
    1314 2004/02/18: Hendrik Bartko
  • trunk/MagicSoft/Mars/mgui/MHexagon.cc

    r3227 r3230  
    170170    // in three coordinate systems: the default one, in which two sides of
    171171    // the hexagon are paralel to the y axis (see camera displays) and two
    172     // more, rotated with respect to that one by +- 60 degrees. The values
    173     // 0.5 and 0.866025403784438597 are the sine and cosine of 60 degrees.
     172    // more, rotated with respect to that one by +- 60 degrees.
    174173    //
    175174
     
    177176      return disthex;
    178177
    179     const Double_t dx2 = dx*0.5 + dy*0.866025403784438597;
     178    const static Double_t cos60 = TMath::Cos(60/kRad2Deg);
     179    const static Double_t sin60 = TMath::Sin(60/kRad2Deg);
     180
     181    const Double_t dx2 = dx*cos60 + dy*sin60;
    180182
    181183    if  (TMath::Abs(dx2) > fD/2.)
    182184      return disthex;
    183185
    184     const Double_t dx3 = dx*0.5 - dy*0.866025403784438597;
     186    const Double_t dx3 = dx*cos60 - dy*sin60;
    185187
    186188    if  (TMath::Abs(dx3) > fD/2.)
Note: See TracChangeset for help on using the changeset viewer.