If you convert your angles to the range -180 to +180, your orginal averageing formula should work. e.g. converting your 'middle = (320 + 20)/2 = 350' to 'middle = (-40 + 20)/2 = -20'.
Not sure if this is what you want though because, given 2 angles, there are 2 middle angles between them: one between the accute angle; one between the, er, other (brain's gone dead - forgotten the name) angle.
jfk: Is this to do with the HSL/RGB conversion functions you posted about a few days back? When I read it, you said you'd already found a solution so I didn't bother posting my HSL/RGB conversion functions. I can still post them if it helps, though. I've just been getting my hands dirty with this stuff recently while writing a 'color picker' for something I'm working on. Lot's of head scratching. :P
Not sure if this is what you want though because, given 2 angles, there are 2 middle angles between them: one between the accute angle; one between the, er, other (brain's gone dead - forgotten the name) angle.
jfk: Is this to do with the HSL/RGB conversion functions you posted about a few days back? When I read it, you said you'd already found a solution so I didn't bother posting my HSL/RGB conversion functions. I can still post them if it helps, though. I've just been getting my hands dirty with this stuff recently while writing a 'color picker' for something I'm working on. Lot's of head scratching. :P