Dynamical variables in brachistochrone problem