stereonet_transforms.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:qgis-stereonet 作者: daniel-childs 项目源码 文件源码
def transform_non_affine(self, xy):
        x = xy[:, 0:1]
        y = xy[:, 1:2]
        clong = self._center_longitude
        clat = self._center_latitude
        p = np.sqrt(x*x + y*y)
        p = np.where(p == 0.0, 1e-9, p)
        c = self._calculate_c(p)
        sin_c = np.sin(c)
        cos_c = np.cos(c)

        lat = np.arcsin(cos_c*np.sin(clat) + ((y*sin_c*np.cos(clat)) / p))
        lon = clong + np.arctan(
                (x*sin_c) / (p*np.cos(clat)*cos_c - y*np.sin(clat)*sin_c))

        return np.concatenate((lon, lat), 1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号