2theta calculation