Changeset 3220 for trunk/MagicSoft/Mars/mgui
- Timestamp:
- 02/17/04 20:10:59 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.