Re: Rectangle subtraction
- From: "Claudio Grondi" <claudio.grondi@xxxxxxxxxx>
- Date: Thu, 9 Jun 2005 14:35:51 -0000
What are you looking for?
The dimensions or the area?
If your door dimensions are W, H
and the dimensions of the wood pieces
are w1, h1 ; w2, h2 ; etc.
you get the total area of the array of
rectangles of glass as follows:
A = W*H - w1*h1 - w2*h2 - ...etc.
The area of the single rectangle
will be A / n, where n is the number
of all rectangles (assuming they are
all the same).
The program will work as follows:
1a. input door height: (H = input)
1b. input door width (W = input)
2. A = H*W
3a. set number of wood pieces n to zero
n = 0
3b. begin loop
input number of same wood pieces (m = input)
or zero to exit
if m == 0 exit loop
else
n = n +1
input wood piece width (w = input)
input wood piece height (h = input)
end if/else
A = A - m*w*h
end loop
4. print 'area of single glass rectangle is : ', A / n
Is it what you are asking for?
Claudio
"Perry van Kuppeveld" <www@xxxxxxx> schrieb im Newsbeitrag
news:42a83236$0$6809$e4fe514c@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> Ik need to write a program to determine the rectangluar spaces in a door.
> The door is built of rectangular pieces of wood.
>
> To solve this i thought the following:
> I have one rectangle (width / height of the door) and subtract all pieces
of
> wood, there's a array of rectangles left, which are the needed rectangles.
>
> I have a poor math knowledge, so any help would be fine.
>
> Thanks,
>
> Perry
>
>
>
>
.
- Follow-Ups:
- Re: Rectangle subtraction
- From: Perry van Kuppeveld
- Re: Rectangle subtraction
- References:
- Rectangle subtraction
- From: Perry van Kuppeveld
- Rectangle subtraction
- Prev by Date: Re: pi
- Next by Date: Re: the decimal-to-fraction key
- Previous by thread: Rectangle subtraction
- Next by thread: Re: Rectangle subtraction
- Index(es):
Relevant Pages
|