Hello, i struggle a bit with an simple geometric problem and i guess it is already solved many times by vpython users but i would love to see an example.
my problem is:
i have an triangle defined by 3 vertex poins ABC
i have an vertical line between points p0 and p1
i know that the line intersects the plane of the triangle because the x and z coordinates
of p0 are inside the x and z coordinates of the triangle
i search an easy/obvious way to compute the missing y coordinate of the intersection point of the line and the triangle.
something of a function like that:
def compute_y(triangle, x, y):
# ....
return y
i played around with interpolating the y values of AB, AC and BC and i tried to solve the line / plane equations using my very rusty high-shool math but i wonder if there does exist a ready-to use function for that case or some vpyhton examples that i can look at and study.
i created some code to visualize the problem: