Treatment of water, waste water, or sewage by heating by distillation or evaporation using waste heat from other processes