Description
– Only accept answers submitted via git push to this course project for you at https://hconnect.hanyang.ac.kr (<Year>_<Course no.>_<Class code>/<Year>_<Course no.>_<Student ID>.git).
– Place your files under the directory structure <Assignment name>/<Problem no.>/<your file> just like the following example.
+ 2021_ITE0000_2019000001
+ LabAssignment2/
+ 1/
– 1.py
+ 2/
– 2.py
+ 3/
– 3.py
– The submission time is determined not when the commit is made but when the git push is made.
1. Write down a Python program to:
A. Create a 1d array M with values ranging from 2 to 26 and print M.
B. Reshape M as a 5×5 matrix and print M.
C. Set the value of “inner” elements of the matrix M to 0 and print M.
D. Assign M2 to the M and print M.
E. Let’s call the first row of the matrix M a vector v. Calculate the magnitude of the vector v and print it.
i. Hint:
ii. Hint: Use np.sqrt()
F. Files to submit: A Python source file (Name the file whatever you want (in English). Extension should be .py)
Expected output:
2. Write down a Python program to draw clock with a regular 12-sided polygon (정12각형). A. Set the window title to your student ID and the window size to (480,480).
B. Use np.linspace() (or np.arrange()), np.cos(), np.sin() to compute the positions of vertices.
C. Use a loop statement to set the positions of all vertices. Do not specify the position by calling glVertex() individually for each vertex.
D. The 12 vertices should be specified counterclockwise starting from the vertex on the x-axis.
E. (Hint)
F. If the keys 1, 2, 3, … 9, 0, Q, W are entered, the time should be changed.
i. Hint1: Use a global variable to store which keyboard button was pressed.
ii. Hint2: Use GL_LINE_LOOP to draw clock, GL_LINES to draw hour hand(시침)
G. Files to submit: A Python source file (Name the file whatever you want (in English). Extension should be .py) H. Expected result:




Reviews
There are no reviews yet.