I'm not quite certain that I understand your problem correctly.
I've attached a sketch of the situation as I understand it. Is it this what you want to calculate?
The green area is the usable part of the floor (maximum), the blue area is the area of glass (fixed value), h is the length of the neighbour and W is the width of the base of the greenhouse.
Everything OK so far?