Languages
[Edit]
EN

TypeScript - calculate intersection point of two lines for given 4 points

0 points
Created by:
Richard-Bevan
413

Intersection point formula for given two points on each line should be calculated in the following way:

Intersection point formula for given two points on each line
Intersection point formula for given two points on each line

Where: L1 and L2 represent points on line 1 and line 2 calculated with linear parametric equation. Points (x1, y1) and (x2, y2) are located on line 1(x3, y3) and (x4, y4) are located on line 2.

Practical example

Edit
Example intersection point calculated in TypeScript.
Example intersection point calculated in TypeScript.

Using TypeScript it is possible to calculate intersection points using the above formula in the following way:

Output:

References

Edit
  1. JavaScript - calculate intersection point of two lines for given 4 points

Alternative titles

  1. TypeScript - how to calculate cross point of two lines for given 4 points?
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join