Exemplo n.º 1
0
p4 = Point(x, y)
# %%
# plt.figure(figsize=(7, 7))
# plt.xlim(-1, 5)
# plt.ylim(-1, 5)
# plt.plot([1],[1],'o')
# plt.plot([2],[1],'o')
# # plt.plot([3*sqrt(2)/2],[3*sqrt(2)/2],'o')
# plt.plot([3/2],[3/2],'o')
# utils.newline((3/2,3/2),((2,1)))
# plt.show()
# %%
# Point(1,0).dot(Point(2,1))/Point(1,0).distance(Point(0,0))

Point.project(p2, Point(1, 0))
a = np.array([[2, 2], [2, 1.5], [1.5, 1.5]])
a1 = np.array([[1, 1]])
a2 = np.array([[2, 1]])
b = np.array([[0, 1]])  # direction
b1 = np.array([[2, 0]])
b2 = np.array([[1, 1]])
c = utils.project(a, b)
plt.figure(figsize=(7, 7))
plt.xlim(-1, 5)
plt.ylim(-1, 5)
plt.plot(a[:, 0], a[:, 1], 'o')
plt.plot(c[:, 0], c[:, 1], 'o')
# plt.plot(b2[:,0],b2[:,1],'o')
plt.show()