It won't make any difference if you're not using views, but a more correct code is:
sf::Vector2f mousepos = window.pixelToCoords(sf::mouse::getPosition(window));
i used windows calculator for value of pi (ripped off some values after point(.)
You should double-check what you copied :P
If all you want to do is move something between two points you don't even need to calculate the angle. Something as simple as the following works.
sf::Vector2f norm = pt1 - pt2;
myObject.setPosition(pt1);
while (window.isOpen())
{
myObject.move(norm * deltaTime);
}