waves.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:zippy 作者: securesystemslab 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号