1#------------------------------------------------------------------------------ 2# Copyright (c) 2005, Enthought, Inc. 3# All rights reserved. 4# 5# This software is provided without warranty under the terms of the BSD 6# license included in enthought/LICENSE.txt and may be redistributed only 7# under the conditions described in the aforementioned license. The license 8# is also available online at http://www.enthought.com/licenses/BSD.txt 9# Thanks for using Enthought open source! 10# 11# Author: Travis N. Vaught 12# Date: 08/2/2005 13# Description: Define units of angle (dimensionless with meaning) 14# 15# 16# Symbols defined: degree and variants 17# 18#------------------------------------------------------------------------------ 19 20############################################################################# 21# Imports: 22############################################################################# 23 24from __future__ import absolute_import 25import math 26from .SI import radian 27 28############################################################################# 29# Definitions: 30############################################################################# 31 32degree = radian * math.pi / 180. 33degree.label = 'deg' 34degrees = degree 35deg = degree 36 37radian.label = 'rad' 38radians = radian 39 40grad = degree * 0.9 41grad.label = '^g' 42grads = grad 43gon = grad 44gons = grad 45 46minute = degree / 60.0 47minutes = minute 48minute.label = "'" 49second = degree / 3600.0 50second.label = '"' 51seconds = second 52 53sign = degree * 30 54signs = sign 55 56revolution = 360 * degree 57revolution.label = 'r' 58revolutions = revolution 59circle = revolution 60circles = circle 61turn = circle 62turns = circles 63 64quadrant = 90 * degree 65quadrants = quadrant 66right_angle = quadrant 67right_angles = quadrant 68 69sextant = 60 * degree 70sextants = sextant 71 72mil = 90 / 1600.0 * degree 73mil.label = 'mil' 74mils = mil 75