Line Segment and Box Intersection
Version 1.0.4 (1,86 ko) par
Ayad Al-Rumaithi
Finds the intersection between a line segment and a box (cuboid)
This function finds the intersection between a line segment and a box (cuboid). Example file is provided.
function [xl2,yl2,zl2]=Line_Box_Intersection(xb,yb,zb,xl,yl,zl)
Input:
xb=[xb1 xb2]: x boundaries of the box
yb=[yb1 yb2]: y boundaries of the box
zb=[zb1 zb2]: z boundaries of the box
xl: (1*2) vector of the line segment x-coordinates
yl: (1*2) vector of the line segment y-coordinates
yl: (1*2) vector of the line segment z-coordinates
Output:
xl2: vector of the intersection x-coordinates
yl2: vector of the intersection y-coordinates
zl2: vector of the intersection z-coordinates
The size of xl2,yl2, and zl2 is (1*2) if there intersection and empty if there is no intersection. If the intersection occur at only single point in the cube corners, the size will be (1*1).
Citation pour cette source
Ayad Al-Rumaithi (2025). Line Segment and Box Intersection (https://www.mathworks.com/matlabcentral/fileexchange/122067-line-segment-and-box-intersection), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Créé avec
R2017b
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
Version | Publié le | Notes de version | |
---|---|---|---|
1.0.4 | Added website |
||
1.0.3 | description |
||
1.0.2 | changed title |
||
1.0.1 | description |
||
1.0.0 |