crosstest2

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 1.1, Creation date: 2013-08-09, Last change: 2025-09-14

return whether a straight line right from point a crosses a line between pa and pb

Description

Used only in PLELboolean and insidePLEL
-1: if p is left of line pa to pb
0: if p is on the the line pa to pb
+1: if p is left of line pa to pb OR outside of horizontal line pa pb



See Also: crosstest

Example Illustration

 missing image of crosstest2(p,pa,pb)

Syntax

t=crosstest2(p,pa,pb)

Input Parameter

p: point to test
pa: start point of line
pb: end point of line

Output Parameter

t: -1==cross; 0== on the line; +1 nothing known

Examples

crosstest2 ([ 0 0], [5 -5], [5 +5])
crosstest2 ([10 0], [5 -5], [5 +5])
crosstest2 ([ 5 0], [5 -5], [5 +5])




Copyright 2013-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21