Intersection sensor Polygon and the road points (curves)

1 view (last 30 days)
Samia Nassir on 20 Mar 2019
hello,
I wrote this code with the help of my friends to get Intersections of polygons and curves.
i now want the total time and the time increase with call the function and how can i call the function in matlab.
for the intersection i used the InterX function ,can you tell me please how can i use the Polyxpoly funktion in this case ,i found in my execusion no intersections also when i want only drawing the sensor polygon i got no result
my code:
plot(xlimitM, ylimitM, 'r')
plot(xlimitN, ylimitN, 'r')
xlimit = [xlimitM, NaN, xlimitN];
ylimit = [ylimitM, NaN, ylimitN];
% two sensor
fovLengthA = 300;
fovOriginA = [-40,30,0];
fovAngleA = 12;
fovLengthB = 200;
fovOriginB = [-10,50,0];
fovAngleB = 35;
[xFoVA, yFoVA] = CircleArc(-1/2*fovAngleA, 1/2*fovAngleA, fovOriginA, fovLengthA);
[xFoVB, yFoVB] = CircleArc(-1/2*fovAngleB, 1/2*fovAngleB, fovOriginB, fovLengthB);
patch('XData', xFoVA, 'YData', yFoVA,...
'FaceColor', 'none', 'EdgeColor', 'r',...
'LineStyle', '-');
patch('XData', xFoVB, 'YData', yFoVB,...
'FaceColor', 'none', 'EdgeColor', 'g',...
'LineStyle', '-');
A = InterX([xlimit; ylimit], [xFoVA; yFoVA]);
plot(A(1,:),A(2,:),'ko')
B = InterX([xlimit; ylimit], [xFoVB; yFoVB]);
plot(B(1,:),B(2,:),'kx')