Hello Delf,
I'll try to clarify it:
First, you draw the side wall (width x height) of the ground floor, above which the ridge is located.
Then you draw the thickness of the ceiling as a "beam" on the wall.
In the middle of the wall, you then draw a line upwards that is 9 meters long to scale - that is your maximum ridge height.
At this point, you set your roof halves with a 30° pitch each and extend these lines beyond the ground floor wall to the right and left.
Then you can extend the outer edges of your ground floor wall upwards until they intersect with the roof line.
Then you only need to measure how long the line is from this intersection point to the top edge of your ground floor ceiling, and you already have your knee wall height.
Regards,
Dirk
PS: However, you must also ensure that the eaves height is not exceeded - for this simply add the knee wall height to the ground floor height (including the ceiling) and observe the 5 m you mentioned.