在指南针点和度数之间转换

portolan的Python项目详细描述


compass points和之间转换 度。这是一个超级小的库,没有依赖关系。

pip install portolan

方法

只有几个:pointtraditionaldegreesmiddlerange

示例

从缩写或十进制度数转换到指南针点:

importportolanportolan.point(abbr='nnw')# 'north-northwest'portolan.point(degree=275.1)# 'west'

转换为地中海盆地的传统名称:

portolan.traditional(degree=12.6)# 'Quarto di Tramontana verso Greco'portolan.traditional(abbr='NEbE')# 'Quarto di Greco verso Levante'

在度数和缩写之间转换:

portolan.abbr(145.0)# 'SEbS'portolan.middle('SEbS')# 146.25portolan.range('SEbS')# (140.625, 151.875)# Remember that North spans the originportolan.range('n')# (354.375, 5.625)# the degrees method returns the minimum, middle, and maximum of a compass pointportolan.degrees('SEbS')# (140.625, 146.25, 151.875)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JAVAutil。整数java的扫描器键盘输入   java通知运行后立即崩溃   java如何在一个只能由类修改而不能由其实例修改的类中生成静态变量?   数据库Java字段猜测   返回值周围的java括号为什么?   java Android更新通讯录中的联系人   一个消费者正在读取数据   java是否可以通过编程方式为蓝牙配对设置pin?   java Spring引导和buildResponseEntity()   java为什么序列化可以在没有实现可序列化的情况下工作   Java同步无助于相互排斥   twitter Java Twitter4J未在推文下显示源标签   为什么Javasocket不支持中断处理?