Finding the width/length of the room

Hi, I want to find the width/length ratio of a room. But, I want the edges to look to north-south direction should always be accepted as width, the east-west direction should always be accepted as length. How can I do that?

Your description is way to vague. The better you describe a problem, the easier and likely it is for somebody to help you!

What does your room look like?
Which supported scripting language do you seek support for?
How far have you taken this already yourself?