Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Java 8, (削除) 41 (削除ここまで) 38 bytes

Java 8, (削除) 41 (削除ここまで) 38 bytes

(x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R

Try it here.

Apparently, Java also has Math.hypot, which is 3 bytes shorter.

EDIT: Just realized this answer is now exactly the same as @OlivierGrégoire's Java 8 answer, so please upvote him instead of me if you like the 38-byte answer.

Old answer (41 bytes):

(x,y,r,X,Y,R)->(x-=X)*x+(y-=Y)*y<(r+=R)*r

Try it here.

#Java 8, (削除) 41 (削除ここまで) 38 bytes

(x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R

Try it here.

Apparently, Java also has Math.hypot, which is 3 bytes shorter.

EDIT: Just realized this answer is now exactly the same as @OlivierGrégoire's Java 8 answer, so please upvote him instead of me if you like the 38-byte answer.

Old answer (41 bytes):

(x,y,r,X,Y,R)->(x-=X)*x+(y-=Y)*y<(r+=R)*r

Try it here.

Java 8, (削除) 41 (削除ここまで) 38 bytes

(x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R

Try it here.

Apparently, Java also has Math.hypot, which is 3 bytes shorter.

EDIT: Just realized this answer is now exactly the same as @OlivierGrégoire's Java 8 answer, so please upvote him instead of me if you like the 38-byte answer.

Old answer (41 bytes):

(x,y,r,X,Y,R)->(x-=X)*x+(y-=Y)*y<(r+=R)*r

Try it here.

added 218 characters in body
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

#Java 8, (削除) 41 (削除ここまで) 38 bytes

(x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R

Try it here.

Apparently, Java also has Math.hypot, which is 3 bytes shorter.

EDIT: Just realized this answer is now exactly the same as @OlivierGrégoire's Java 8 answer , so please upvote him instead of me if you like the 38-byte answer.

Old answer (41 bytes):

(x,y,r,X,Y,R)->(x-=X)*x+(y-=Y)*y<(r+=R)*r

Try it here.

#Java 8, (削除) 41 (削除ここまで) 38 bytes

(x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R

Try it here.

Apparently, Java also has Math.hypot, which is 3 bytes shorter.

Old answer (41 bytes):

(x,y,r,X,Y,R)->(x-=X)*x+(y-=Y)*y<(r+=R)*r

Try it here.

#Java 8, (削除) 41 (削除ここまで) 38 bytes

(x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R

Try it here.

Apparently, Java also has Math.hypot, which is 3 bytes shorter.

EDIT: Just realized this answer is now exactly the same as @OlivierGrégoire's Java 8 answer , so please upvote him instead of me if you like the 38-byte answer.

Old answer (41 bytes):

(x,y,r,X,Y,R)->(x-=X)*x+(y-=Y)*y<(r+=R)*r

Try it here.

Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

#Java 8, (削除) 41 (削除ここまで) 38 bytes

(x,y,r,X,Y,R)->Math.hypot(x-X,y-Y)<r+R

Try it here.

Apparently, Java also has Math.hypot, which is 3 bytes shorter.

Old answer (41 bytes):

(x,y,r,X,Y,R)->(x-=X)*x+(y-=Y)*y<(r+=R)*r

Try it here.

AltStyle によって変換されたページ (->オリジナル) /