stereonet_math.py 文件源码

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

项目:qgis-stereonet 作者: daniel-childs 项目源码 文件源码
def cart2sph(x, y, z):
    """
    Converts cartesian coordinates `x`, `y`, `z` into a longitude and latitude.
    x=0, y=0, z=0 is assumed to correspond to the center of the globe.
    Returns lon and lat in radians.

    Parameters
    ----------
    `x`, `y`, `z` : Arrays of cartesian coordinates

    Returns
    -------
    lon : Longitude in radians
    lat : Latitude in radians
    """
    r = np.sqrt(x**2 + y**2 + z**2)
    lat = np.arcsin(z/r)
    lon = np.arctan2(y, x)
    return lon, lat
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号