• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(400)  |  Call(316)  |  Derive(0)  |  Import(84)
asin(x)

Return the arc sine (measured in radians) of x.

src/p/y/pycppad-HEAD/example/std_math.py   pycppad(Download)
 
  # all the a_float unary standard math functions
  assert abs( arccos(a_x) - math.acos(x) )  < delta
  assert abs( arcsin(a_x) - math.asin(x) )  < delta
  assert abs( arctan(a_x) - math.atan(x) )  < delta
  assert abs( cos(a_x)    - math.cos(x) )   < delta
  assert abs( cosh(a_x)   - math.cosh(x) )  < delta
 
  # all the a2float unary standard math functions
  assert abs( arccos(a2x) - math.acos(x) )  < delta
  assert abs( arcsin(a2x) - math.asin(x) )  < delta
  assert abs( arctan(a2x) - math.atan(x) )  < delta
  assert abs( cos(a2x)    - math.cos(x) )   < delta
  assert abs( cosh(a2x)   - math.cosh(x) )  < delta

src/p/y/pysolar-HEAD/solar.py   pysolar(Download)
 
	first_term = math.cos(latitude_rad) * math.cos(declination_rad) * math.cos(math.radians(hour_angle))
	second_term = math.sin(latitude_rad) * math.sin(declination_rad)
	return math.degrees(math.asin(first_term + second_term))
 
def GetApparentSiderealTime(julian_day, jme, nutation):
	return GetMeanSiderealTime(julian_day) + nutation['longitude'] * math.cos(GetTrueEclipticObliquity(jme, nutation))
	hour_angle_rad = math.radians(GetHourAngle(utc_datetime, longitude_deg))
	altitude_rad = math.radians(GetAltitude(latitude_deg, longitude_deg, utc_datetime))
 
	azimuth_rad = math.asin(math.cos(declination_rad) * math.sin(hour_angle_rad) / math.cos(altitude_rad))
 
	if(math.cos(hour_angle_rad) >= (math.tan(declination_rad) / math.tan(latitude_rad))):
		return math.degrees(azimuth_rad)
 
	a = math.sin(geocentric_latitude_rad) * math.cos(true_ecliptic_obliquity_rad)
	b = math.cos(geocentric_latitude_rad) * math.sin(true_ecliptic_obliquity_rad) * math.sin(apparent_sun_longitude_rad)
	delta = math.asin(a + b)
	return math.degrees(delta)
 
def GetGeocentricSunRightAscension(apparent_sun_longitude, true_ecliptic_obliquity, geocentric_latitude):
def GetTopocentricElevationAngle(latitude, topocentric_sun_declination, topocentric_local_hour_angle):
    latitude_rad = math.radians(latitude)
    tsd_rad = math.radians(topocentric_sun_declination)
    tlha_rad = math.radians(topocentric_local_hour_angle)
    return math.degrees(math.asin((math.sin(latitude_rad) * math.sin(tsd_rad)) + math.cos(latitude_rad) * math.cos(tsd_rad) * math.cos(tlha_rad)))
 
def GetTopocentricLocalHourAngle(local_hour_angle, parallax_sun_right_ascension):

src/a/g/agtl-0.7.1.0-freerunner0/advancedcaching/geo.py   agtl(Download)
        rbearing = math.radians(bearing)
        rdistance = distance / self.RADIUS_EARTH # normalize linear distance to radian angle
 
        rlat = math.asin( math.sin(rlat1) * math.cos(rdistance) + math.cos(rlat1) * math.sin(rdistance) * math.cos(rbearing) )
 
        if math.cos(rlat) == 0 or abs(math.cos(rlat)) < 0.00001: # Endpoint a pole
            rlon=rlon1
        else:
            rlon = ( (rlon1 - math.asin( math.sin(rbearing)* math.sin(rdistance) / math.cos(rlat) ) + math.pi ) % (2*math.pi) ) - math.pi

src/o/b/obspy-HEAD/obspy.signal/trunk/obspy/signal/rotate.py   obspy(Download)
 
import warnings
import numpy as np
from math import sqrt, pi, sin, cos, asin, tan, atan, atan2
 
 
def rotate_NE_RT(n, e, ba):
        Cos_sigma = sin(U1) * sin(U2) + cos(U1) * cos(U2) * cos(dlon)
        sigma = atan2(Sin_sigma, Cos_sigma)
        Sin_alpha = cos(U1) * cos(U2) * sin(dlon) / sin(sigma)
        alpha = asin(Sin_alpha)
        Cos2sigma_m = cos(sigma) - (2 * sin(U1) * sin(U2) / pow(cos(alpha), 2))
        C = (f / 16) * pow(cos(alpha), 2) * \
            (4 + f * (4 - 3 * pow(cos(alpha), 2)))

src/s/e/semanticsbml-HEAD/trunk/trash/sbml2dot_sbmlmergemath.py   semanticsbml(Download)
                    libsbml.AST_FUNCTION_ARCTAN:    math.atan,
                    libsbml.AST_FUNCTION_ARCCOT:    lambda x: math.acos(x / math.sqrt(1 + x**2)),
                    libsbml.AST_FUNCTION_ARCSEC:    lambda x: 1 / math.acos(x),
                    libsbml.AST_FUNCTION_ARCCSC:    lambda x: 1 / math.asin(x),
                    libsbml.AST_FUNCTION_ARCSINH:   lambda x: math.log(x + math.sqrt(x**2  + 1)),
                    libsbml.AST_FUNCTION_ARCCOSH:   arccosh,
                    libsbml.AST_FUNCTION_ARCTANH:   arctanh,

src/t/r/transimsstudio-HEAD/Source/Releases/0.9.9-08-18-2010/TransimsGUI/TransimsGUI/NetEdit.py   transimsstudio(Download)
 
			arrow_poly.append(self.WorldToScreen(ptB[0],ptB[1]))
 
			aabs=math.asin(abs(ptA[1]-ptB[1])/((ptA[1]-ptB[1])**2+(ptA[0]-ptB[0])**2+.001)**.5) 
			if ptA[1]>ptB[1] and abs(ptA[0]-ptB[0])<3: aabs=0
			elif ptA[0]>ptB[0] and abs(ptA[1]-ptB[1])<3: aabs=math.pi/2
			elif ptA[1]<ptB[1] and abs(ptA[0]-ptB[0])<3: aabs=math.pi
			elif ptA[0]<ptB[0] and abs(ptA[1]-ptB[1])<3: aabs=math.pi*3/2
			elif ptA[1]>ptB[1] and ptA[0]>ptB[0]: aabs=math.pi/2-aabs
			elif ptA[1]<ptB[1] and ptA[0]>ptB[0]: aabs=aabs+math.pi/2
			elif ptA[1]<ptB[1] and ptA[0]<ptB[0]: aabs=math.pi*3/2-aabs
			elif ptA[1]>ptB[1] and ptA[0]<ptB[0]: aabs=math.pi*3/2+aabs
 
			brel=math.asin(widthB/(length**2+widthB**2+.001)**.5)
			arrow_poly.append(self.WorldToScreen(x,y))
 
 
			brel=math.asin(widthA/(length**2+widthA**2+.001)**.5)
			babs=aabs-brel
 
			x=(length**2+widthA**2)**.5*math.sin(babs)+ptB[0]
			arrow_poly.append(self.WorldToScreen(ptA[0],ptA[1]))
 
 
			brel=math.asin(widthA/(length**2+widthA**2+.001)**.5)
			babs=aabs+brel
 
			x=(length**2+widthA**2)**.5*math.sin(babs)+ptB[0]
			y=(length**2+widthA**2)**.5*math.cos(babs)+ptB[1]
 
			arrow_poly.append(self.WorldToScreen(x,y))
 
 
			brel=math.asin(widthB/(length**2+widthB**2+.001)**.5)

src/a/s/Astropysics-0.1.dev-r699/astropysics/coords/coordsys.py   Astropysics(Download)
            else:
                if cycle > 0:
                    #this means use "triangle wave" pattern with the given quarter-period 
                    from math import sin,asin
                    offset = low/(low-up)-0.5
                    return (up-low)*(asin(sin(pi*(2*rads/cycle+offset)))/pi+0.5)+low
                else:
    def __sub__(self,other):        
        if isinstance(other,self.__class__):
            from math import cos,degrees,acos,asin,sin,sqrt
 
            b1 = self._lat.radians
            b2 = other._lat.radians
            db = abs(b2 - b1)
 
            havsep = hdb + cos(b1)*cos(b2)*hdl
            #archaversin
            sep = acos(1 - 2*havsep) if 0.25 < havsep <= 0.75 else 2*asin(havsep**0.5)
 
            #straightforward definition without the tweaks using haversin - this
            #is in principal faster, but in practice it ends up only about

src/g/r/gramps-HEAD/trunk/src/PlaceUtils.py   gramps(Download)
                 D2*math.cos(4.0*xi)*math.sinh(4.0*eta) - \
                 D3*math.cos(6.0*xi)*math.sinh(6.0*eta) - \
                 D4*math.cos(8.0*xi)*math.sinh(8.0*eta)
    psi = math.asin(math.sin(xip)/math.cosh(etap))
    DL = math.atan2(math.sinh(etap),math.cos(xip))
    LON = L0 + DL
    A = e2 + pow(e2,2) + pow(e2,3) + pow(e2,4)

src/s/e/semanticsbml-HEAD/trash/sbml2dot_sbmlmergemath.py   semanticsbml(Download)
                    libsbml.AST_FUNCTION_ARCTAN:    math.atan,
                    libsbml.AST_FUNCTION_ARCCOT:    lambda x: math.acos(x / math.sqrt(1 + x**2)),
                    libsbml.AST_FUNCTION_ARCSEC:    lambda x: 1 / math.acos(x),
                    libsbml.AST_FUNCTION_ARCCSC:    lambda x: 1 / math.asin(x),
                    libsbml.AST_FUNCTION_ARCSINH:   lambda x: math.log(x + math.sqrt(x**2  + 1)),
                    libsbml.AST_FUNCTION_ARCCOSH:   arccosh,
                    libsbml.AST_FUNCTION_ARCTANH:   arctanh,

src/w/e/weewx-HEAD/trunk/experimental/astral.py   weewx(Download)
 
import datetime
import time
from math import cos, sin, tan, acos, asin, atan2, floor, radians, degrees
 
__version__ = "0.3+"
__author__ = "Simon Kennedy <python@sffjunkie.co.uk>"
def _sun_declination(juliancentury):
    e = _obliquity_correction(juliancentury)
    lambd = _sun_apparent_long(juliancentury)
 
    sint = sin(radians(e)) * sin(radians(lambd))
    return degrees(asin(sint))
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next