|
Given an integer A, denoting the length of a cube, the task is to find the shortest distance between the diagonal of a cube and an edge skew to it i.e. KL in the below figure. Examples :
Approach: The idea to solve the problem is based on the following mathematical formula:
Below is the implementation of the above approach: C++
Javascript
Output:
1.41421
Time Complexity: O(1) |
Reffered: https://www.geeksforgeeks.org
Geometric |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 14 |