Please refer to the image at the bottom for the description, below.

Given two hypothetical line segments:

**a** from point3 **A1** to point3 **A2**

**b** from point3 **B1** to point3 **B2**

If we were to create a new segment, **c**, which extends from point3 **A2** to point3 **B3** where it intersects segment **b**, making **c** an extension of segment **a** from its end point **A2** to the new point **B3** (i.e., segment **c** should be collinear with **a**), how would we go about doing this using Maxscript and let’s assume all coordinates are in World space to make life simpler?

Note that the angle of intersection, **𝛂**, could be acute, right, or obtuse, depending on the direction of **a** and **b**.

To make things simpler, I am most interested in a function that returns the new intersection point3 **B3**, given point3s **A1**, **A2**, **B1** and **B2** as parameters, assuming of course that segment **a** would intersect segment **b** if projected as indicated by **c**. I suppose the function could return undefined if **a** and **b** are parallel or skew (i.e., not co-planar) with respect to each other.

```
fn findIntersectionPoint A1 A2 B1 B2
(
B3=[0,0,0] -- Point of intersection, to be calculated
/* Calculation code
...
*/
B3
)
```

Thanks you for your help!