# https://blog.youkuaiyun.com/weixin_41285821/article/details/80360924?
# utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2
# ~all~first_rank_v2~rank_v25-3-80360924.nonecase&utm_term=python%
# 20%E4%B8%89%E7%82%B9%E5%AE%9A%E4%BD%8D
import numpy as np
import math
import sympy
from matplotlib.pyplot import plot
from matplotlib.pyplot import show
import matplotlib.pyplot as plt
# 随机产生3个参考节点坐标
maxy = 1000
maxx = 1000
cx = maxx * np.random.rand(3)
cy = maxy * np.random.rand(3)
dot1 = plot(cx, cy, 'k^')
# 生成盲节点,以及其与参考节点欧式距离
mtx = maxx * np.random.rand()
mty = maxy * np.random.rand()
dot2 = plot(mtx, mty, 'go')
da = math.sqrt(np.square(mtx - cx[0