arc length computation, used by sin and cos function