<script src="./point_src/constrain-distance-locked"></script>
Calculate the distance between pointA and pointB
const clamp = (a, min = 0, max = 1) => Math.min(max, Math.max(min, a));
Calculate the distance between pointA and pointB