10 examples of 'math sin python' in Python

Every line of 'math sin python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
512def Sin(num):
513 """Return the sin of a value"""
514 return math.sin(float(num))
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

16def sin(angle):
17 '''Sine of an angle (in degrees)'''
18 return _math.sin(angle * _dg)
10def f(x, z): return np.sin(np.sqrt(x ** 2 + z ** 2))
14def sin(self, t: np.array = None) -> np.array:
15 """Sinus waveform.
16
17 Parameters
18 ----------
19 t : array_like, optional
20 If not time array is provided, a default buffer sized array
21 with a 2*PI period will be used.
22
23 Returns
24 -------
25 waveform : ndarray
26 Sinusoidal waveform with samples in the normalized range [-1,+1].
27
28 References
29 ----------
30 https://docs.scipy.org/doc/numpy/reference/generated/numpy.sin.html
31
32 See Also
33 --------
34 square
35 sawtooth
36 """
37 if t is None:
38 t = self._wavetime()
39 return np.sin(t)
692def sin_cuda(a):
693
694 """ Trigonometric sine of GPUArray elements.
695
696 Parameters
697 ----------
698 a : gpuarray
699 GPUArray with elements to be operated on.
700
701 Returns
702 -------
703 gpuarray
704 sin(GPUArray)
705
706 Examples
707 --------
708 >>> a = sin_cuda(give_cuda([0, pi/4]))
709 [ 0., 0.70710678]
710
711 >>> type(a)
712 <class 'pycuda.gpuarray.GPUArray'>
713
714 """
715
716 return pycuda.cumath.sin(a)
106def _sinDeg(angle):
107 return math.sin(math.radians(angle))
20def cosd(x):
21 return cos(radians(x))
106def cos(x):
107 return mod(x).cos(x)
49def t_sin():
50 X_train = np.arange(1.0,10,1.0).reshape(-1,1)
51 Y_train = np.sin(X_train)
52 X_test = np.arange(1.0,10,3.8).reshape(-1,1)
53 Y_test = np.sin(X_test)
54 return (X_train, Y_train, X_test, Y_test)
5def f(t):
6 return (0.67*sqrt(t)*cos(2*pi*sqrt(t)), 0.5*sqrt(t)*sin(2*pi*sqrt(t)))

Related snippets