Circle - Segment intersection
#4

Yes konst should be <0
And yes i made a mistake when i was copying code.
it should be
if((u1>=0 || u1<=1) && (u2>=0 || u2<=1))


I did some testing and this is what it returned
BC = 0
DE = 1
FG = 1
IH = 0
JK = 1
LM = 1

For IH konst is -0.745452 and it returned 0. That is because float can have only 7 digits and that is not enough for precise calculation. I don't know if there is double or long double implementation for pawn.

LM is not intersecting the circle but it is still returning 1. I need t work on that.
Reply


Messages In This Thread
Circle - Segment intersection - by PeppeAC - 01.07.2013, 10:04
Re: Circle - Segment intersection - by Antonio144 - 01.07.2013, 15:11
Re: Circle - Segment intersection - by PeppeAC - 01.07.2013, 15:31
Re: Circle - Segment intersection - by Antonio144 - 01.07.2013, 17:34
Re: Circle - Segment intersection - by PeppeAC - 01.07.2013, 17:48
Re: Circle - Segment intersection - by Antonio144 - 01.07.2013, 18:01
Re: Circle - Segment intersection - by PeppeAC - 01.07.2013, 18:27

Forum Jump:


Users browsing this thread: 1 Guest(s)