Yes, the real distance squared is:

```javascript
var diff = Cartesian3.subtract(sphere.center, cartesian);
var distance = Cartesian3.magnitude(diff) - sphere.radius;
var distanceSquared = distance * distance;
```
We used the distance squared to avoid the `sqrt`. If we want to change it to exact, we would need to compute the distance.