tags:

views:

69

answers:

1

I'm using php and gd library to draw a triangle. I'm able to draw triangle and add text to it(using imagettftext). But now i'm stuck with a problem.

The two sides of the triangle are 'x' and 'x+2'. So hypotenuse will be sqrt(x^2+(x+2)^2). But i dont know how to show this equation using proper mathematical(i mean using square root symbol etc.) in the image using gd functions as a label to the hypotenuse.

Is there a way for doing it?

A: 

Don't know if the sign will work in imagettftext but here it is . To do it (on mac) you press Alt (option) + J.

hellozimi
that works.. anyway to show x^2 as in mathematics textbooks?
robert
There are some at http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts√(x²+(x+2)²)I Hope this works!
hellozimi