.distance_to() in 3D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The BlindEye

I’m trying to do this code for Collision detection in 3D (Advanced vector math — Godot Engine (stable) documentation in English), but I got stuck with Plane.distance_to().
Does someone know the formula behind it?

Thanks :smiley:

:bust_in_silhouette: Reply From: timothybrentwood

distance_to() should be implemented using the standard euclidean distance formula:
distance = sqrt( (x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2 )