I can't help with the math either, but I can basically go over the how the set slope things operate. I would probably take some of Risen's advice, though, as I'm not much as far as efficient/pretty map construction goes and he probably knows better.
Anyway, there are three things important to how the set slope things work: the thing facing angle, the slope angle argument, and the thing's position within the sector (including Z height.)
1) The thing's facing angle determines the direction of the slope. If the set slope thing is facing
to the east and the angle is set to 45 degrees upwards, than the slopes rises from west to east (lowest point on the west end, highest point on the east end).
2) The slope angle argument determines the steepness of the slope. A value of 90 is considered horizontal (no slope), and values above 90 slope upwards in the given direction while values below 90 slope downwards in the given direction. So, 135 is 45 degrees upwards, and 45 is 45 degrees downward. Note that taken with the thing's facing angle, there's more than one way to generate the same slope. For example,
facing east +
135 (45 degrees upwards) is the same thing as
facing west +
45 (45 degrees downwards).
3) The thing's position in 3D space is the final important piece. The slope of the sector will be adjusted so that it passes through the set slope thing itself. This means where you position the thing within the sector itself
does matter, as well as the thing's Z height. As an example, let's take a room at floor height 0 with a small 32 x 32 square sector in the center, also at floor height 0. Now, let's say you want to make the sector's floor slope from 0 on its north edge to 32 on its south edge (so, set slope thing facing south, value of 135.) You start by placing the set floor slope thing in the dead center of the 32 x 32 sector, face the thing south, and give it a value of 135. If you were to test the map at this point, you would find the effect isn't complete yet, however. Instead of a slope from 0 to 32 going north to south, you would find your sector sloped from -16 to +16 going north to south. This is because the slope must pass through the slope thing's position in space. The slope thing, being a set floor slope thing, is located on the floor of the sector (with height 0). Hence, the result goes from -16 to +16 to pass through the slope thing (located at 0 in the middle). Given this, there's more than one way to fix it to achieve the desired effect of sloping from 0 to 32.
- Set the thing's Z height to 16, which will raise the slope (since it must pass through the thing itself).
- Raise the sector height to 16, which has the net effect of raising the thing itself to a Z height of 16, being place on the floor of the sector it is in (note that the set sector ceiling slope behaves like a "hanging from ceiling" object and is attached to the ceiling by default.)
- Set the thing's Z height to 8, and then move it north from the center of the sector by 8 (placing it 1/4 of the way down from the top, instead of in the middle at 1/2). Again, the slope will pass through the thing itself, so moving its position in the X/Y plane does have an effect.
- Numerous other possibilities (Z height: 24, 3/4 of the way down from the top), etc.