Changeset 3220 for trunk/MagicSoft
- Timestamp:
- 02/17/04 20:10:59 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3219 r3220 12 12 13 13 * mgui/MHexagon.cc 14 - fixed comment in DistanceToPrimitive(Float_t px, Float_t py) 15 The pixel "radius" here used is that of the "outer" circle, not 16 of the inner one as previously stated. Added FIXME comment to 17 implement better calculation in the future. 18 14 - DistanceToPrimitive(Float_t px, Float_t py) Changed check of 15 whether px,py is inside the pixel or not. Previous algorithm 16 was just an approximation. 19 17 20 18 2004/01/17: Raquel de los Reyes -
trunk/MagicSoft/Mars/mgui/MHexagon.cc
r3219 r3220 154 154 // ------------------------------------------------------------------------ 155 155 // 156 // compute the distance of a point (px,py) to the Hexagon in world156 // compute the distance of a point (px,py) to the Hexagon center in world 157 157 // coordinates. Return -1 if inside. 158 158 // … … 164 164 const Double_t dx = px-fX; 165 165 const Double_t dy = py-fY; 166 const Double_t disthex = TMath::Sqrt(dx*dx + dy*dy); 167 168 if (TMath::Abs(dx) > fD/2.) 169 return disthex; 170 171 const Double_t dx2 = dx*0.5 + dy*0.866025403784438597; 172 173 if (TMath::Abs(dx2) > fD/2.) 174 return disthex; 175 176 const Double_t dx3 = dx*0.5 - dy*0.866025403784438597; 177 178 if (TMath::Abs(dx3) > fD/2.) 179 return disthex; 180 181 return -1; 182 } 183 184 /* 185 Float_t MHexagon::DistanceToPrimitive(Float_t px, Float_t py) 186 { 187 // 188 // compute the distance of the Point to the center of the Hexagon 189 // 190 const Double_t dx = px-fX; 191 const Double_t dy = py-fY; 166 192 167 193 const Double_t disthex = TMath::Sqrt(dx*dx + dy*dy); … … 177 203 // 178 204 } 205 */ 179 206 180 207 // ------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.