Пример #1
0
 public boolean isPrime(double dNum) {
   for (int i = 2; i <= Math.sqrt(dNum); i++) {
     if (dNum % i == 0) {
       return false;
     }
   }
   return true;
 }
Пример #2
0
 public boolean CheckIntersection(PVector point) {
   float dist =
       (float)
           Math.sqrt(
               Math.pow((double) (point.x - origin.x), 2.0)
                   + Math.pow((double) (point.y - origin.y), 2.0));
   if (dist < radiusX) {
     return true;
   }
   return false;
 }