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

📅  最后修改于: 2021-09-22 10:47:34             🧑  作者: 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