rectangle function - triangle function