Intersection of Two Lines (line_intersection)

Finds the intersection of two lines.
888 Downloads
Updated 19 Sep 2023

line_intersection View Intersection of Two Lines (line_intersection) on File Exchange Open in MATLAB Online

Finds the intersection of two lines.

Syntax

[x_int,y_int] = line_intersection(l1,l2)

Inputs

  • l1 (1×1, 1×2, 1×3, or 1×4 double) vector defining line 1:
    • [x1]: vertical line form,
    • [m1,b1]: slope-intercept form,
    • [x1,y1,m1]: point-slope form,
    • [x1,y1,x2,y2]: two point form,
  • l2 (1×1, 1×2, 1×3, or 1×4 double) vector defining line 2:
    • [x2]: vertical line form,
    • [m2,b2]: slope-intercept form,
    • [x2,y2,m2]: point-slope form,
    • [x3,y3,x4,y4]: two point form,

Outputs

  • x_int (1×1 double): -coordinate of line intersection,
  • y_int (1×1 double): -coordinate of line intersection,

Examples and Additional Documentation

  • See "EXAMPLES.mlx" or the "Examples" tab on the File Exchange page for examples.
  • See "Intersection_of_Two_Lines.pdf" (also included with download) for the technical documentation.

Cite As

Tamas Kis (2024). Intersection of Two Lines (line_intersection) (https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v6.0.1), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2023a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
6.0.1.0

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v6.0.1

6.0.0

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v6.0.0

5.0.4

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v5.0.4

5.0.3

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v5.0.3

5.0.2

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v5.0.2

5.0.1.0

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v5.0.1

5.0.0

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v5.0.0

4.0.0

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v4.0.0

3.0.1

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v3.0.1

3.0.0

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/3.0.0

2.0.3.0

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v2.0.3

2.0.1

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v2.0.1

2.0.0

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v2.0.0

1.0.3

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v1.0.3

1.0.2

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v1.0.2

1.0.1

See release notes for this release on GitHub: https://github.com/tamaskis/line_intersection-MATLAB/releases/tag/v1.0.1

1.0.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.