image thumbnail

point to line distance

version 1.3.2 (3.52 KB) by Rik
calculate the distance between a 2D or 3D line and one or more points

1.6K Downloads

Updated 05 Jul 2020

From GitHub

View license on GitHub

You can input either a 2D or a 3D line and 2D or 3D points. This function is an extended version of the line below, with some input checking:
distance=norm(cross(v1-v2,pt-v2))/norm(v1-v2)

Licence: CC by-nc-sa 4.0

Cite As

Rik (2021). point to line distance (https://github.com/thrynae/point_to_line_distance/releases/tag/1.3.2), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2020a
Compatible with R13SP1 and later releases
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
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.