Found this, very useful.
How to create Room tag including Width x Depth parameters
and a nice use of maths
Room Length: ((Perimeter / 2) - sqrt((Perimeter / 2) ^ 2 - 4 * Area)) / 2
Room Width: Area / Room Length
example included.
|
Found this, very useful.
How to create Room tag including Width x Depth parameters
and a nice use of maths
Room Length: ((Perimeter / 2) - sqrt((Perimeter / 2) ^ 2 - 4 * Area)) / 2
Room Width: Area / Room Length
example included.
Sweet. One can easily see the quadratic formula peeking through, and since there are by definition two positive real roots, this implementation ignores the smaller one ("width") and simply produces the longer one ("length") instead of fussing with the whole +/- thing. Beware non-rectangular rooms, however.
Just used this attachments - it's brilliant thankyou!