Oriented Measures and the Bang-bang Principle