Compose a program that writes the coordinates of a random


You 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.

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Compose a program that writes the coordinates of a random
Reference No:- TGS02874826

Expected delivery within 24 Hours