TDT4109/Exercise 7/1.py

17 lines
381 B
Python
Raw Permalink Normal View History

2020-10-20 22:58:37 +02:00
import numpy as np
import matplotlib.pyplot as plt
def areOrthagonal(list1,list2):
vec1 = np.array(list1)
vec2 = np.array(list2)
return np.dot(vec1,vec2) == 0
def createColumnArray():
return np.arange(1,16).reshape(3,5).transpose()
if __name__ == "__main__":
print(areOrthagonal([0,1],[1,0]))
print(areOrthagonal([1,0],[1,0]))
print()
print(createColumnArray())