Hi pgimeno!
Sorry for late reply but have suffered a major power outage.
Discovered that the edge case failures in my code was related to " relational operator" failure.
When determining if circle was within radius of sector, the conditional statement occasional fails.
dis = distance of circle circle to center of arc => using sqrt distance calculation
lng = radius of segment
rad = radius of circle
condition: dis < (lng + rad)
test: print( dis, lng, rad, dis<(lng+rad) )
failure prints: "260,250,10,true"
If I round the distance (math.round(dis,3), I don't get the failure.
?
Boolean function for intersection between circular segment and circle
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Boolean function for intersection between circular segment and circle
Uh? Can you give a complete function? Also, math.round is not standard lua, so please include it as well.Ref wrote: ↑Sun Aug 15, 2021 2:51 pm Hi pgimeno!
Sorry for late reply but have suffered a major power outage.
Discovered that the edge case failures in my code was related to " relational operator" failure.
When determining if circle was within radius of sector, the conditional statement occasional fails.
dis = distance of circle circle to center of arc => using sqrt distance calculation
lng = radius of segment
rad = radius of circle
condition: dis < (lng + rad)
test: print( dis, lng, rad, dis<(lng+rad) )
failure prints: "260,250,10,true"
If I round the distance (math.round(dis,3), I don't get the failure.
?
But my understanding is that the failures have to do with the angle comparisons, not with the distance comparisons.
- Gunroar:Cannon()
- Party member
- Posts: 1142
- Joined: Thu Dec 10, 2020 1:57 am
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 10 guests