How is TREND function calculated in zerodha PI software(tradescript language)

image

can anyone explain how the trend function is calculated in zerodha pi

thank you!