Problem solved:
// d is the position of the house or fisical element where I want to point the view
var d = {lat: 43.538524840485, lng: 10.322718769311};
var whereToLookLatLng = new google.maps.LatLng(parseFloat(d.lat), parseFloat(d.lng));
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('pano'),
panoramaOptions
);
map.setStreetView(panorama);
var service = new google.maps.StreetViewService;
// With this function I get the panorama, if available, next the house or fisical element where I want to point the view
service.getPanoramaByLocation(panorama.getPosition(), 50,
function(panoData) {
if (panoData != null) {
// MamLatLng is the position of the point of view
var ManLatLng = panoData.location.latLng;
// Now I calculate the heading to point the view in the direction of whereToLookLatLng
var heading = google.maps.geometry.spherical.computeHeading(ManLatLng, whereToLookLatLng);
var pov = panorama.getPov();
pov.heading = heading;
panorama.setPov(pov);
}
});
}