triangle is used as a library