def equation(self, type='cosine'):
"""
Returns equation of the wave.
Examples
========
>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A, phi, f = symbols('A, phi, f')
>>> w = TWave(A, f, phi)
>>> w.equation('cosine')
A*cos(2*pi*f*t + phi)
"""
if not isinstance(type, str):
raise TypeError("type can only be a string.")
if type == 'cosine':
return self._amplitude*cos(self.angular_velocity*Symbol('t') + self._phase)
评论列表
文章目录