-
Notifications
You must be signed in to change notification settings - Fork 25
/
Blood Moon.js
13 lines (11 loc) · 867 Bytes
/
Blood Moon.js
1
2
3
4
5
6
7
8
9
10
11
12
13
/*
Description:
Alan is going to watch the Blood Moon (lunar eclipse) tonight for the first time in his life. But his mother, who is a history teacher, thinks the Blood Moon comes with an evil intent. The ancient Inca people interpreted the deep red coloring as a jaguar attacking and eating the moon. But who believes in Inca myths these days? So, Alan decides to prove to her mom that there is no jaguar. How? Well, only little Alan knows that. For now, he needs a small help from you. Help him solve the following calculations so that he gets enough time to prove it before the eclipse starts.
Screenshot-3
Three semicircles are drawn on AB, AD, and AF. Here CD is perpendicular to AB and EF is perpendicular to AD.
Task
Given the radius of the semicircle ADBCA, find out the area of the lune AGFHA (the shaded area).
*/
function bloodMoon(r){
return r*r/4
}