# General expression for the total length

#### MATHEMATICIAN

Math Team
i want to derive an expression to calculate the total length of the green lines in the following figure.

1. Firstly we have a L-shape frame of green lines.
2. Horizontal green lines are places inside the frame starting from the bottom, each "D" distance apart.
3. Vertical green lines are placed inside the frame starting from the left, each "D" distance apart.
4. Arrow shows the direction how the lines are placed.
5. The last vertical/horizontal green line is "D or less" distance from the green line that forms the L-shape frame.

#### Attachments

• 13.1 KB Views: 0

#### DarnItJimImAnEngineer

N1 = number of lines of length L1 = $\displaystyle \left \lfloor \frac{W2-W1}{D}+1 \right \rfloor$
N2 = number of lines of length (L1-L2) = $\displaystyle \left \lfloor \frac{W2}{D} - N1 + 2 \right \rfloor$
N3 = number of lines of length W1 = $\displaystyle \left \lfloor \frac{L2-L1}{D}+1 \right \rfloor$
N4 = number of lines of length (W1-W2) = $\displaystyle \left \lfloor \frac{L2}{D} - N3 + 2 \right \rfloor$
Plus one wire of length L2 and one wire of length W2. Enough information for you?

1 person

#### MATHEMATICIAN

Math Team
I also agree with N1 and N3 (beside you have interchanged L1&L2 and W1&W2)

N2 = ceil(W1/D +1 - N1)?
N4 = ceil(L1/D + 1 - N3)?

#### DarnItJimImAnEngineer

I think that works out to be the same thing, doesn't it? Check against your sample picture.

#### MATHEMATICIAN

Math Team
The sample picture is just a representation. The last spacing can be "D" or "less than D". That way floor function will change the picture. Please read the description.

#### DarnItJimImAnEngineer

Ah, you're right. (To be fair, I understood the setup, I just... can't count, apparently.)

#### MATHEMATICIAN

Math Team
I also discovered something.
I think we cannot add those L2 and W2 in cases where, the last distance between green line and the frame is exactly "D"
What's your opinion on this ?