Hi all !
My code to check if an angle betwween two segments is 90 degrees or not. here it is :
...................................................
first_seg = car(cline_seg)
second_seg = nthelem(2,cline_seg)
x11=caar(first_seg->startEnd)
y11=cadar(first_seg->startEnd)
x12=car(lastelem(first_seg->startEnd))
y12=lastelem(lastelem(first_seg->startEnd))
x21=caar(second_seg->startEnd)
y21=cadar(second_seg->startEnd)
x22=car(lastelem(second_seg->startEnd))
y22=lastelem(lastelem(second_seg->startEnd))
a = axlDistance(x11:y11, x12:y12)
b = axlDistance(x21:y21, x22:y22)
c = axlDistance(x11:y11, x22:y22)
if(c*c == (a*a + b*b) then
fprintf(writeOutFile, "Location (%L %L)\n", x12,y12)
);end if
...................................
the result are: " E- *Error* range: argument #1 should be a number (type template = "n") - nil ". I think axlDistance command have got error, but only command a = axlDistance(x11:y11, x12:y12) is OK. How can I fix it? Please help me.
PS: x11,y11 --------------------x12,y12 x21,y21--------------------x22,y22
(x11, y11) (x12,y12) = (-19885.0 26245.0) (-19885.0 26400.0)
(x21, y21) (x22,y22) = (-19885.0 26400.0) (-19985.0 26500.0)