Re: Boolean function for intersection between circular segment and circle
Posted: 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.
?
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.
?