add triangle and invtriangle