Skip to main content
added 13 characters in body
Source Link
G B
  • 23.6k
  • 1
  • 24
  • 55

Ruby, 87 82 77 7774 bytes

->*a{a.map!{|a,b,c|(w=[ac|x,y,z=[a-b,b-c,a-c].map (&:abs).map{|x|xsort;[x/w.sum}.sortz,y/z]}.uniq!=a}

Try it online!Try it online!

Given the 2 triangles as vectors of 3 complex numbers, calculate length of the three sides as distance between points, sort ascending, then normalize and check if the result isa/b and a/c are the same for both.

Ruby, 87 82 77 bytes

->*a{a.map!{|a,b,c|(w=[a-b,b-c,a-c].map &:abs).map{|x|x/w.sum}.sort}.uniq!=a}

Try it online!

Given the 2 triangles as vectors of 3 complex numbers, calculate length of the three sides as distance between points, then normalize and check if the result is the same.

Ruby, 87 82 77 74 bytes

->*a{a.map!{|a,b,c|x,y,z=[a-b,b-c,a-c].map(&:abs).sort;[x/z,y/z]}.uniq!=a}

Try it online!

Given the 2 triangles as vectors of 3 complex numbers, calculate length of the three sides as distance between points, sort ascending, then check if a/b and a/c are the same for both.

deleted 5 characters in body
Source Link
G B
  • 23.6k
  • 1
  • 24
  • 55

Ruby, 87 82 8277 bytes

->*a{a.map!{|a,b,c|(w=[a-b,b-c,a-c].map( &:abs)).map{|x|x/w.sum}.sort}.reduce(&:==)uniq!=a}

Try it online!Try it online!

Given the 2 triangles as vectors of 3 complex numbers, calculate length of the three sides as distance between points, then normalize and check if the result is the same.

Ruby, 87 82 bytes

->*a{a.map{|a,b,c|(w=[a-b,b-c,a-c].map(&:abs)).map{|x|x/w.sum}.sort}.reduce(&:==)}

Try it online!

Given the 2 triangles as vectors of 3 complex numbers, calculate length of the three sides as distance between points, then normalize and check if the result is the same.

Ruby, 87 82 77 bytes

->*a{a.map!{|a,b,c|(w=[a-b,b-c,a-c].map &:abs).map{|x|x/w.sum}.sort}.uniq!=a}

Try it online!

Given the 2 triangles as vectors of 3 complex numbers, calculate length of the three sides as distance between points, then normalize and check if the result is the same.

added 2 characters in body
Source Link
G B
  • 23.6k
  • 1
  • 24
  • 55

Ruby, 8787 82 bytes

->*a{!(a.map{|a,b,c|[ac|(w=[a-b,b-c,a-c].map(&:abs).sort}.transpose).map{|a,b|a|x|x/bw.to_fsum}|[].sort}.reduce(&:==)[1]}

Try it online!Try it online!

Given the 2 triangles as vectors of 3 complex numbers, calculate length of the three sides as distance between points, then normalize and check if the result is the same.

Ruby, 87 bytes

->*a{!(a.map{|a,b,c|[a-b,b-c,a-c].map(&:abs).sort}.transpose.map{|a,b|a/b.to_f}|[])[1]}

Try it online!

Ruby, 87 82 bytes

->*a{a.map{|a,b,c|(w=[a-b,b-c,a-c].map(&:abs)).map{|x|x/w.sum}.sort}.reduce(&:==)}

Try it online!

Given the 2 triangles as vectors of 3 complex numbers, calculate length of the three sides as distance between points, then normalize and check if the result is the same.

Source Link
G B
  • 23.6k
  • 1
  • 24
  • 55
Loading