sine with case for pi multiples
489470
def _sin(x):
    ''''''
    return 0. if np.isclose(np.mod(x, np.pi), 0.) else np.sin(x)
1038308
function(p,phi,theta) {
        var r = 0;
        r += Math.pow(mathUtils.sin(this.m[0] * theta), this.m[1]);
        r += Math.pow(mathUtils.cos(this.m[2] * theta), this.m[3]);
        r += Math.pow(mathUtils.sin(this.m[4] * phi), this.m[5]);
        r += Math.pow(mathUtils.cos(this.m[6] * phi), this.m[7]);

        var sinTheta = mathUtils.sin(theta);
        p.x = r * sinTheta * mathUtils.cos(phi);
        p.y = r * mathUtils.cos(theta);
        p.z = r * sinTheta * mathUtils.sin(phi);
        return p;
    }
1167004
def underscored2camel_case(v):
    """"""
    vlist = v.split('_')
    c = []
    for n, el in enumerate(vlist):
        if el:
            if n == 0:
                c.append(el)
            else:
                c.extend([el[0].upper(), el[1:]])
    return ''.join(c)
1023437
def convert_case(name):
        """"""
        s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
        return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
37890
def _J(self, theta):
        
        if self.order == 0:
            return np.pi - theta
        elif self.order == 1:
            return tf.sin(theta) + (np.pi - theta) * tf.cos(theta)
        elif self.order == 2:
            return 3. * tf.sin(theta) * tf.cos(theta) + \
                   (np.pi - theta) * (1. + 2. * tf.cos(theta) ** 2)
466403
void sin(ECoordinate angle) {
		double sinv = Math.sin(angle.m_value);
		double cosv = Math.cos(angle.m_value);
		m_value = sinv;
		double absv = Math.abs(sinv);
		m_eps = (Math.abs(cosv) + absv * 0.5 * angle.m_eps) * angle.m_eps
				+ epsCoordinate() * absv;
	}
374200
function( h, s, v )
            {
                var r, g, b, i, f, p, q, t;
                i = Math.floor(h * 6);
                f = h * 6 - i;
                p = v * (1 - s);
                q = v * (1 - f * s);
                t = v * (1 - (1 - f) * s);
                switch (i % 6)
                {
                    case 0: r = v, g = t, b = p; break;
                    case 1: r = q, g = v, b = p; break;
                    case 2: r = p, g = v, b = t; break;
                    case 3: r = p, g = q, b = v; break;
                    case 4: r = t, g = p, b = v; break;
                    case 5: r = v, g = p, b = q; break;
                }
                var hr = Math.floor(r * 255).toString(16);
                var hg = Math.floor(g * 255).toString(16);
                var hb = Math.floor(b * 255).toString(16);
                return '#' + (hr.length < 2 ? '0' : '') + hr +
                             (hg.length < 2 ? '0' : '') + hg +
                             (hb.length < 2 ? '0' : '') + hb;
            }
1016985
function(theta) {
            while (theta < 0) {
                theta += mathUtils.TWO_PI;
            }
            return this.sinLUT[((theta * this.rad2deg) + this.quadrant) % this.period];
        }
985977
def sine(x):
    '''
    
    '''
    if sps.issparse(x):
        x = x.copy()
        x.data = np.sine(x.data)
        return x
    else: return np.sin(x)
389812
def sin_3(a=1):
    """

    def lhs(x):
        return x/(a**2 + x**2)

    def rhs(b):
        return np.pi*np.exp(-a*b)/2

    return Ghosh('sin', lhs, rhs)
347322
function ip2long( a, b, c, d ) {
   for (
     c = b = 0;
     d = a.split('.')[b++];
     c +=
     d >> 8
     |
     b > 4 ?
     NaN
     :
     d * (1 << -8 * b)
     )
   d = parseInt(
     +d
     &&
     d
     );
   return c
   }
762529
def calculate_wave(i, lst_bin, wpm=WPM, frequency=FREQUENCY, framerate=FRAMERATE, amplitude=AMPLITUDE, seconds_per_dot=SECONDS_PER_DOT):
    
    bit = morse_bin(i=i, lst_bin=lst_bin, wpm=wpm, framerate=framerate,
                    default_value=0.0, seconds_per_dot=seconds_per_dot)
    sine = sine_wave(i=i, frequency=frequency, framerate=framerate, amplitude=amplitude)
    return bit * sine
820016
def p_case_def(self, p):
        ''''''
        if len(p) == 5:
            p[0] = ('case', (p[2], p[4]))
        elif len(p) == 4:
            p[0] = ('default', p[3])
108050
function() {

      // acsc(c) = -i * log(i / c + sqrt(1 - 1 / c^2))

      var a = this['re'];
      var b = this['im'];

      if (a === 0 && b === 0) {
        return new Complex(Math.PI / 2, Infinity);
      }

      var d = a * a + b * b;
      return (d !== 0)
              ? new Complex(
                      a / d,
                      -b / d).asin()
              : new Complex(
                      (a !== 0) ? a / 0 : 0,
                      (b !== 0) ? -b / 0 : 0).asin();
    }
1052690
def sine_wave(i, frequency=FREQUENCY, framerate=FRAMERATE, amplitude=AMPLITUDE):
    
    omega = 2.0 * pi * float(frequency)
    sine = sin(omega * (float(i) / float(framerate)))
    return float(amplitude) * sine
1142832
public static double Sin(double x, int nTerms) {
        if (nTerms < 2) return x;
        if (nTerms == 2) {
            return x - (x * x * x) / 6D;
        } else {

            double mult = x * x * x;
            double fact = 6;
            double sign = 1;
            int factS = 5;
            double result = x - mult / fact;
            for (int i = 3; i <= nTerms; i++) {
                mult *= x * x;
                fact *= factS * (factS - 1);
                factS += 2;
                result += sign * (mult / fact);
                sign *= -1;
            }

            return result;
        }
    }
18002
def sinwave(n=4,inc=.25):
		
	x=np.arange(-n,n,inc)
	y=np.arange(-n,n,inc)
	X,Y=np.meshgrid(x,y)
	R = np.sqrt(X**2 + Y**2)
	Z = np.sin(R)/(.5*R)
	return pd.DataFrame(Z,index=x,columns=y)