[code=python]import numpy as np
x1_1 = float(input("請輸入第一個公共點x1新坐標"))
y1_1 = float(input("請輸入y1新坐標"))
x1_2 = float(input("請輸入x1原坐標"))
y1_2 = float(input("請輸入y1原坐標"))
x2_1 = float(input("請輸入第二個公共點x2新坐標"))
y2_1 = float(input("請輸入y2新坐標"))
x2_2 = float(input("請輸入x2原坐標"))
y2_2 = float(input("請輸入y2原坐標"))
def Sicanshu(a,b,c,d):
B = np.array([[1, 0, x1_2, -y1_2],
[0, 1, y1_2, x1_2],
[1, 0, x2_2, -y2_2],
[0, 1, y2_2, x2_2],])
X = np.array([[a],
[b],
[c],
[d]])
J = np.array([[x1_1],
[y1_1],
[x2_1],
[y2_1]])
P=np.matlib.eye(6,6,0,dtype=int)
因為剛開始學python,實在是困難。我想知道怎樣能在python里添加未知數,矩陣運算去求未知數,矩陣的逆和我該如何根據點位的多少來進行增加矩陣的運算量。還有就是numpy庫的使用。希望有大神能來幫幫我
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/275952.html
