Personally I've always done it by the length of the snake for vivs (I'm guessing terrariums are similar) (And I don't know about tubs). So the width and length should added together be no bigger than the length of the snake. So 24" plus 18" is 42", so you'd be able to have a snake up to that length.