-1

Is there any way to calculate the symmetric difference between two regions (triangle and circle) in java (android)?

I have classes like this

public class Triangle{ double[] a; double[] b; double[] c; }

public class Circle{ double center; double radius; }

and now i need to know the symmetric difference between those regions. I can not find anything related to do this.

Cimoe
  • 580
  • 6
  • 21

1 Answers1

2

This is not available in the standard Java APIs as far as I know. You will need to do this yourself. To start it might be helpful to note that the area of the symmetric difference is the differences of the areas of the union and the intersection of the two regions. The area of the union is the sum of the areas of the two regions minus the area of the intersection. So it boils down to calculating the area of the intersection. What are the possible shapes of the intersection of a circle and a triangle?

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
  • Thank you for your answer. I have found an answer on [how to compute the intersection between a circle and a triangle](http://stackoverflow.com/questions/540014/compute-the-area-of-intersection-between-a-circle-and-a-triangle). Now it should not be a problem to get the symmetric difference. – Cimoe Sep 12 '16 at 20:45