📜  可以围绕半径为R的球面外接的圆锥的最小体积

📅  最后修改于: 2021-05-06 19:02:25             🧑  作者: Mango

给定半径为R的球体,任务是找出可以外接的最小圆锥体体积。

例子:

输入: R = 10输出:圆锥体的体积= 8373.33说明:圆锥体的半径= 14.14,圆锥体的高度= 40,圆锥体的体积= (1/3) * \pi * r^2 * h因此,体积= 8373.33输入: R = 4输出:圆锥体的体积= 535.89

方法:
我们给出了一个用圆锥体表示的半径为R的球体。我们需要找出圆锥的半径和高度,以找出圆锥的体积。

  1. 在三角形AOE和ALC中计算sin(X),即对于三角形AOE sin(X) = (R/H-R)   对于三角形ALC sin(X) = (r/\sqrt{r^2 + H^2})
  2. 现在,通过将两者相等,我们得到H = ( (-2 (r^2) R) / (R^2 - r^2))
  3. 在Volume中插入H的值,即V = (1/3) * (3.14) * (r^2) * (H)   并将体积最小化d(V)/dr = 0
  4. 从上面的等式我们可以得到r = \sqrt{2} * R   并将这个值放在H中,我们得到 H = 4*R
  5. 因此,应用圆锥体积和推杆的公式r = \sqrt{2} * R   H = 4 * R   我们得到理想的结果。
C++
// C++ program to find the minimum
// volume of the cone that can be 
// circumscribed about a sphere
// of radius R
#include
using namespace std;
 
// Function to find the volume
// of the cone
float Volume_of_cone(float R)
{
     
    // r = radius of cone
    // h = height of cone
    // Volume of cone = (1 / 3) * (3.14) * (r*r) * (h)
    // we get radius of cone from the derivation
    // is root(2) times multiple of R
    // we get height of cone from the derivation
    // is 4 times multiple of R
    float V = (1 / 3.0) * (3.14) * (2 * ( R * R ) ) * (4 * R);
     
    return V;
}
     
// Driver code
int main()
{
    float R = 10.0;
    cout << Volume_of_cone(R);
}
     
// This code is contributed by Samarth


Java
// Java program to find the minimum
// volume of the cone that can be
// circumscribed about a sphere
// of radius R
import java.util.*;
 
class GFG{
 
// Function to find the volume
// of the cone
static double Volume_of_cone(double R)
{
     
    // r = radius of cone
    // h = height of cone
    // Volume of cone = (1 / 3) * (3.14) * (r*r) * (h)
    // we get radius of cone from the derivation
    // is root(2) times multiple of R
    // we get height of cone from the derivation
    // is 4 times multiple of R
    double V = (double)((1 / 3.0) * (3.14) * (2 * (R * R)) *
                                                  (4 * R));
    return V;
}
     
// Driver code
public static void main(String[] args)
{
    double R = 10.0;
    System.out.print(Volume_of_cone(R));
}
}
 
// This code is contributed by sapnasingh4991


Python3
# Python3 program to find the minimum
# Volume of the cone that can be circumscribed
# about a sphere of radius R
 
import math
 
# Function to find the volume
# of the cone
 
def Volume_of_cone(R):
 
    # r = radius of cone
    # h = height of cone
    # Volume of cone = (1 / 3) * (3.14) * (r**2) * (h)
    # we get radius of cone from the derivation
    # is root(2) times multiple of R
    # we get height of cone from the derivation
    # is 4 times multiple of R
     
    V = (1 / 3) * (3.14) * (2 * ( R**2 ) ) * (4 * R)
     
    return V
     
 
# Driver code
if __name__ == "__main__":
     
    R = 10
     
    print(Volume_of_cone(R))


C#
// C# program to find the minimum
// volume of the cone that can be
// circumscribed about a sphere
// of radius R
using System;
class GFG{
 
// Function to find the volume
// of the cone
static double Volume_of_cone(double R)
{
     
    // r = radius of cone
    // h = height of cone
    // Volume of cone = (1 / 3) * (3.14) * (r*r) * (h)
    // we get radius of cone from the derivation
    // is root(2) times multiple of R
    // we get height of cone from the derivation
    // is 4 times multiple of R
    double V = (double)((1 / 3.0) * (3.14) *
                    (2 * (R * R)) * (4 * R));
    return V;
}
     
// Driver code
public static void Main()
{
    double R = 10.0;
    Console.Write(Volume_of_cone(R));
}
}
 
// This code is contributed by Nidhi_biet


Javascript


输出:
8373.333333333332