monxa

Untitled

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