Update Triangle gradient.py

Updated some functions