05-23-2010, 05:19 PM
|
#7 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
That seems like a good method.
Quote:
Originally Posted by maeltar
Ok... it's to work out how many stairs are required for a staircase...
x = Height of floor
y and z are the min and max rise allowed per stair at a given angle (UK Building Regulations)
so (a) has got to be a whole number as thats the quantity of stairs, but this is not known until it's calculated by iterating though a loop to find out what value fits...
so the way I see it I need to do something like
$a = 1
while x / $a > y
$a ++
followed by
$a = 50
while x / $a < z
$a--
Something on those lines (Obviously have simplified it for easier reading)
That should give me the max and min quantity of steps in the staircase... So need to round (a) to the nearest whole number and do a quick..
(x) / (a) to give me the exact rise of step which will be between (y) and (z)
|
|
|
|
|