Question: I need solution taking command line arguments in python 1. Point. Compose a program that writes the coordinates of a random point (a, b, c)

I need solution taking command line arguments in python

1. Point. Compose a program that writes the coordinates of a random point (a, b, c) on the surface of a sphere. To generate such a point, use Marsaglia's method: Start by picking a random point (x, y) in the unit disk using the method described at the end of this section. Then, set a to 2 x sqrt(1 - x2 - y2), b to 2 sqrt(1 - x2 - y2), and c to 1 - 2 (x2 + y2).

2. Exponential function. Assume that x is a float. Compose a program that uses the Taylor series expansion to assign ex = 1 + x + x2/2! + x3/3! + ... to total.

3. GCD problem. Compose a program that accepts two integers x and y from the command-line, and finds and writes the greatest common divisor (gcd) of x and y using Euclid's algorithm, which is an iterative computation based on the following observation: if x > y, then if y divides x, the gcd of x and y is y; otherwise the gcd of x and y is the same as the gcd of x % y and y.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!