As stated in the documentation, do not use any undocumented features. I can't stress this enough - it's a really terrible thing for support and compatibility which pretty much always ends in disaster for everybody, but it still seems to be hard to keep getting this message across. Undocumented features are not guaranteed to keep working as they are internal details of the engine and are subject to change at any time. If you use them, your code could break at any time and we won't offer support if that happens either. The official documentation also stresses this, which also points out:
The only reason these can be found is because the way JavaScript works makes it difficult to hide them.
Just make your own, especially as these functions are really simple. For example distanceTo is just Math.hypot(x2 - x1, y2 - y1)
, angleTo is just Math.atan2(y2 - y1, x2 - x1)
, toDegrees is x * 180 / Math.PI
... I'm sure you can find many more equivalents with a quick web search.