Thanks Mudin for your reply.
Your calculation for ath seems to work, but if a hotspot is placed far from 0 degree in atv, it does not work because the relation between width and h coordinates changes.
The things are far more complicated when hotspot's attributes like edge, rx, ry or rz are set other than default value.
To calculate correctly, we need to know basic structure of this panorama stuff or krpano provides us function.
I hope klaus give us clear answer.