Pivot point calcultion

Check this post