Write a script (box.py) that determines if a point is inside of the box bounded by the points
(0, 0) and (1, 1). The script should take two required arguments, an x and a y coordinate. Hint: Remember that script arguments are strings.
|
Input |
Output |
|
0.2 0.4 |
(0.2, 0.4) is in the box. |
|
-0.1 0.5 |
(-0.1, 0.5) is outside the box. |
|
00 |
(0.0, 0.0) is in the box. |
coors = input().split()
x = float(coors[0])
y = float(coors[1])
inside = 0 <= x <= 1 and 0 <= y <= 1
if inside:
print("({}, {}) is in the box.".format(x, y))
else:
print("({}, {}) is outside the box.".format(x, y))

Write a script (box.py) that determines if a point is inside of the box bounded by...
Write function to check if point O is located inside or outside of the 2D triangle ABC The coordinates of the vertices are defined inside Coordinates.dat file. Read this file inside main m-file and provide the coordinates as an input to the function. Also ask user to input coordinates of the point O and provide it as input to the function as well. The output of the function should be a message, saying that the point is located inside or...
Write a script which receives a list of strings as parameters. Input an “ index string ”. Iterate through the list of strings and apply the `expr index …` operation on each string using the index string as the index. Output the string and the result of the index operation. When done, run it passing the string abacab foxtrot duke trespass and input the index string of abcd. Your output should be abacab 1, duke 1, foxtrot 0, trespass 6.
please solve in matlab
1[35p) Write a user-defined MATLAB function that determines the unit vector in the direction of the line that connects two points (A and B) in space. For the func- tion name and arguments, use n = unitvec (A,B). The input to the function are two vectors A and B, each with the Cartesian coordinates of the corre- sponding point. The output is a vector with the components of the unit vector Join the direction from A...
This question is from the textbook "Python for ArcGIS" by Laura Tateosian: Write a script "triangles.py" that takes three arguments, the lengths of three sides of a triangle. Then define the following three functions: 1. perimeter takes three side lengths as arguments and returns the perimeter length. 2. triangleType takes three side lengths as arguments, determines if it is an equilateral triangle, an isosceles triangle, or neither. The result is returned. 3. area takes three side lengths as arguments and...
Create chart or table Consider the system with the impulse response ht)e u(t), as shown in Figure 3.2(a). This system's response to an input of x(t) 1) would be y(t) h(r ult 1). as shown in Figure 3.2(b). If the input signal is a sum of weighted, time-shifted impulses as described by (3.10), separated in time by Δ = 0.1 (s) so that xt)01-0.1k), as shown in Figure 3.2(c), then, according to (3.11), the output is This output signal is...
MATLAB Question: Write a script for the problem pictured. Please
send the script, not just the printout. Make sure your script
allows you to input a value for n
so when prompted, in the command window, user types n value. The
n value should be the f_k if k ==1 .... Please also send print outs
if you can.
BELOW IS A SAMPLE ANSWER THAT DID NOT PUT THE INPUT SCRIPT
NEEDED FOR THIS QUESTION TO BE CORRECT. YOU CAN...
Write a script that prints a randomly generated integer between 1 and 6. When I run your script, it should print out only the number that would appear on the die like this: 5 and nothing else. Write a script that takes input for the number of sides on the die. An n sided die should return a random integer between 1 and n with the same stipulations as in Exercise 1. You should take n from the user as...
SHELL SCRIPT: Provide the following questions with the codes and command line Problem 5: Take 5 input arguments in a for loop, but only add the even i values to sum and display the result. Problem 6: Write a shell script that accepts path of the directory and returns a count of all the files within the specified directory. (Hint: use alias to perform cd operation) Problem 7: Write a shell script that takes an ‘count’ value as an input...
Matlab code for this problem.
1[35pl Write a user-defined MATLAB function that determines the unit vector in the direction of the line that connects two points (A and B) in space. For the func- tion name and arguments, use n = unitvec (A,B). The input to the function are two vectors A and B, each with the Cartesian coordinates of the corre- sponding point. The output is a vector with the components of the unit vector in the direction from...
For each function, identify an inside and outside function.
Write an expression for the derivative.
For each function, identify an inside and outside function. Write an expression for the derivative. 2. g(t) = 12 ln(542 +) 1. y = (3x – 20) inside: u(x) = inside: u(t) = outside: v(u) = outside: g(u) = 3. f(x) - 43* - 60 4. g(x) = 4(x2 + 2)10 inside: u(2) = inside: u(x) = outside: f(u) = outside: g(u) = 5. 9(2)...