Ignore:
Timestamp:
02/18/04 16:40:01 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.