Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func foot_of_the_perpendicular(point_tip: Vector3, point_line1: Vector3, point_line2: Vector3) -> Vector3:
- var a: Vector3 = point_tip
- var b: Vector3 = point_line1
- var c: Vector3 = point_line2
- var bc: Vector3 = c - b # Vector along the line
- var t: float = (a - b).dot(bc) / bc.length_squared() # Projection factor
- return b + t * bc
Advertisement
Add Comment
Please, Sign In to add comment