wrong tangent calculation