I think it's nicer to have an intuitive way, not really some algorithm when it comes to a platformer, for example wall jump like in Celeste.