Lightoj 1331 Ajent J
Problem Link
Click here to see the discussion in Bangla
In the movie Dhoom 2, Hrithik Roshan’s diamond theft scene is quite famous. Similarly, LightOJ problem 1331 is about a diamond theft.
Here we have an agent ‘J’ who wants to steal the diamond kept in a museum. But the theft isn’t that easy, because there are three circular laser scanners, continuously rotating.
These three circles are placed in such a way that each circle is externally tangent to the other two, and the diamond is placed in the middle enclosed region.
Our task is to find the area of that enclosed region (the shaded diamond-shaped area). The radii of the three circles are given: .
Step 1: Forming the Triangle
If we connect the centers of the three circles, we form a triangle.
-
The distance between the centers of circle and :
-
The distance between the centers of circle and :
-
The distance between the centers of circle and :
Step 2: Area of the Triangle
Once we have the three sides , we can calculate the area of the triangle using Heron’s formula.
First compute the semi-perimeter:
Then, the triangle’s area is:
Step 3: Sector Areas (Circular Arcs)
From basic geometry, we know that the area of a circular sector is:
where is the circle’s radius and is the angle in radians subtended at the circle’s center.
So, to compute the circular sectors inside the triangle, we need the angles of the triangle at the vertices.
Using the cosine rule:
Now, the sector areas are:
Step 4: The Diamond Area
Finally, the required shaded region (diamond area) is:
For source code: Source code
0 comments:
Post a Comment