Area of Squares Formed by Joining Mid Points Repeatedly in C Program

Arnab Chakraborty
Updated on 20-Aug-2019 12:44:02

133 Views

Suppose we have one square whose side is ‘a’. We will make more squares by attaching the mid-points of the squares repeatedly. The number of repetition is n times. We have to find the area of nth square.As the side of the outer square is ‘a’, then area isNow using Pythagorean theorem, we can get the area of the second rectangle is −Similarly, area of 3rd square is −Using this we can understand that the area of nth square is −Example#include #include using namespace std; float area(float a, float n) {    if (a < 0 ) //if ... Read More

Area of Largest Triangle Inscribed in a Rectangle in C Program

Arnab Chakraborty
Updated on 20-Aug-2019 12:38:37

167 Views

Suppose one rectangle is given. We know the length L and breadth B of it. We have to find the area of largest triangle that can be inscribed within that rectangle −The largest triangle will always be the half of the rectangle. So it will beExample#include #include using namespace std; float area(float l, float b) {    if (l < 0 || b < 0 ) //if the valuse are negative it is invalid       return -1;    float area = (l*b)/2;    return area; } int main() {    float a = 10, b = 8;    cout

Area of Largest Rectangle Inscribed in an Ellipse

Arnab Chakraborty
Updated on 20-Aug-2019 12:33:28

307 Views

Here we will see the area of largest rectangle that can be inscribed in an ellipse. The rectangle in ellipse will be like below −The a and b are the half of major and minor axis of the ellipse. The upper right corner of the rectangle is (x, y). So the area isNow, after making this equation as f(x) and maximizing the area, we will get the area asExample#include #include using namespace std; float area(float a, float b) {    if (a < 0 || b < 0 ) //if the valuse are negative it is invalid   ... Read More

Area of Largest Circle Inscribed in N-Sided Regular Polygon in C Program

Arnab Chakraborty
Updated on 20-Aug-2019 12:29:48

224 Views

Here we will see how to get the area of the circle which is inscribed in N-sided regular polygon. The N (number of sides) are given, and each side of the polygon is ‘a’The approach is simple. One N sided polygon can be divided into N equal triangles, the whole angle for each triangle in center is 360/N, so −Example#include #include using namespace std; float area(float n, float a) {    if (n < 0 || a < 0 ) //if the valuse are negative it is invalid       return -1;    float r = a/(2.0*tan((180/n) ... Read More

Calculate Area of Hexagon with Given Diagonal Length in C

Arnab Chakraborty
Updated on 20-Aug-2019 12:23:31

373 Views

Here we will see how to get the area of one hexagon using diagonal length. The diagonal length of the hexagon is d.The interior angles of a regular hexagon are 120° each. The sum of all interior angles are 720°. If the diagonal is d, then area is −Example#include #include using namespace std; float area(float d) {    if (d < 0) //if d is negative it is invalid       return -1;    float area = (3 * sqrt(3) * d*d)/8.0;    return area; } int main() {    float r = 10;    cout

C Program for Area of Decagon Inscribed Within the Circle

Arnab Chakraborty
Updated on 20-Aug-2019 12:19:06

207 Views

Here we will see how to get the area of decagon which is present inside the circle. The radius is given. The side of the decagon is ‘a’.As we know that the side of the decagon is like below −So the area is −Example#include #include using namespace std; float area(float r) {    if (r < 0) //if r is negative it is invalid       return -1;    float area = (5 * pow(r, 2) * (3 - sqrt(5)) * (sqrt(5) + (2 * sqrt(5)))) / 4;    return area; } int main() {    float r = 8;    cout

Area of Circumcircle of a Right Angled Triangle in C Program

Arnab Chakraborty
Updated on 20-Aug-2019 12:14:41

200 Views

Here we will see how to get the area of circumcircle of a right angled triangle. The hypotenuse of the triangle is forming the diameter of the circle. So if the hypotenuse is h, then radius is h/2So the area is −Example Code#include #include using namespace std; float area(float h) {    if (h < 0) //if h is negative it is invalid       return -1;    float area = 3.1415 * (h/2) * (h/2);    return area; } int main() {    float h = 8;    cout

Area of Circle Inscribed in Equilateral Triangle in C Program

Arnab Chakraborty
Updated on 20-Aug-2019 12:09:05

326 Views

Here we will see the area of circle which is inscribed in an equilateral triangle. The sides of the triangle are ‘a’.The area of equilateral triangle −The semi-perimeter of the triangle is −So the radius of the circle is −Example#include #include using namespace std; float area(float a) {    if (a < 0 ) //if the value is negative it is invalid       return -1;    float area = 3.1415 * (a/(2*sqrt(3))) * (a/(2*sqrt(3)));    return area; } int main() {    float a = 4;    cout

Area of Circle Inscribed Within Rhombus in C Program

Arnab Chakraborty
Updated on 20-Aug-2019 12:02:47

197 Views

Here we will see the area of circle which is inscribed in a rhombus. The diagonals of the rhombus are ‘a’ and ‘b’. The radius of the circle is h.Two diagonals are creating four equal triangles. Each triangle is right-angled triangle, so their area is −Each side of the rhombus is the hypotenuses −So the area of the circle is −Example#include #include using namespace std; float area(float a, float b) {    if (a < 0 || b < 0) //if the values are negative it is invalid       return -1;    float area = (3.1415 ... Read More

Area of Triangle Inscribed in Rectangle and Ellipse in C

Arnab Chakraborty
Updated on 20-Aug-2019 11:56:52

100 Views

Here we will see the area of a triangle which in inscribed in one rectangle and that circle is inscribed in an ellipse. The half of the major and minor axis are ‘a’ and ‘b’ respectively. Suppose the length of the rectangle is ‘l’ and breadth is ‘h’We know that the area of the rectangle in an ellipse is −The area of the triangle is −Example#include #include using namespace std; float area(float a, float b) {    if (a < 0 || b < 0) //if the values are negative it is invalid       return -1; ... Read More

Advertisements