Changed rssq to norm.
This commit is contained in:
parent
043b4e61ba
commit
31425d2692
@ -2,7 +2,7 @@ function ret = calculateDistanceFromPointToLine(p0 , p1, p2)
|
|||||||
p01 = p0 - p1;
|
p01 = p0 - p1;
|
||||||
p12 = p2 - p1;
|
p12 = p2 - p1;
|
||||||
CrossProduct = [p01(2)*p12(3) - p01(3)*p12(2), p01(3)*p12(1) - p01(1)*p12(3), p01(1)*p12(2) - p01(2)*p12(1)];
|
CrossProduct = [p01(2)*p12(3) - p01(3)*p12(2), p01(3)*p12(1) - p01(1)*p12(3), p01(1)*p12(2) - p01(2)*p12(1)];
|
||||||
ret = rssq(CrossProduct) / rssq(p12);
|
ret = norm(CrossProduct) / norm(p12);
|
||||||
|
|
||||||
%Height of parallelogram (Distance between point and line) = Area of parallelogram / Base
|
%Height of parallelogram (Distance between point and line) = Area of parallelogram / Base
|
||||||
%Area = One side of parallelogram X Base
|
%Area = One side of parallelogram X Base
|
||||||
|
Loading…
Reference in New Issue
Block a user