An equilateral triangle of side t, a square of side s and a circle of radius r touch each other in a right triangle ABC with vertical side BC=a. Find t in terms of a.
Source: Adapted from Sacred Mathematics by Fukagawa Hidetoshi and Tony Rothman (originally a Sangaku by Watanabe Kiichi)