Skip to main content
Commonmark migration
Source Link

R, 39 bytes

function(k,r)dist(matrix(k,2,2))<sum(r)

takes input k=c(x1,x2,y1,y2) and r=c(r1,r2); returns FALSE for tangent circles.

Try it online!

###27 bytes:

27 bytes:

function(m,r)dist(m)<sum(r)

Takes input as a matrix with the circle centers given as rows and a vector of radii.

Try it online!

R, 39 bytes

function(k,r)dist(matrix(k,2,2))<sum(r)

takes input k=c(x1,x2,y1,y2) and r=c(r1,r2); returns FALSE for tangent circles.

Try it online!

###27 bytes:

function(m,r)dist(m)<sum(r)

Takes input as a matrix with the circle centers given as rows and a vector of radii.

Try it online!

R, 39 bytes

function(k,r)dist(matrix(k,2,2))<sum(r)

takes input k=c(x1,x2,y1,y2) and r=c(r1,r2); returns FALSE for tangent circles.

Try it online!

27 bytes:

function(m,r)dist(m)<sum(r)

Takes input as a matrix with the circle centers given as rows and a vector of radii.

Try it online!

Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

R, 39 bytes

function(k,r)dist(matrix(k,2,2))<sum(r)

takes input k=c(x1,x2,y1,y2) and r=c(r1,r2); returns FALSE for tangent circles.

Try it online!

###27 bytes:

function(m,r)dist(m)<sum(r)

Takes input as a matrix with the circle centers given as rows and a vector of radii.

Try it online!