SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

Vectores no Plano
Quando Pedro me fala sobre Paulo
Sei mais do Pedro do que do Paulo
Sigmund Freud
  • Rotate vector [; \underline{i} ;], respectively [; \underline{j}=\widehat{\underline{i}} ;], angle θ:
    [; \left( \underline{i},\underline{j} \right) ;] formam uma base de ortogonal [; \mathbb{R}^2 ;], orientada postivamente (contra relógio).
    Python Listing: ../../Code/Vector.py.
    def O(dim=2):
        #Origin
        return Vector(dim)
    
    #Unit Vectors
    
    def i():
        return Vector([1.0,0.0])
    
    def j():
        #i's complement (normal)
        return Vector([0.0,1.0])
    
    

    Anota-se o nível de indentação:
    Estes def's returnam um Vector, mas não são métodos deste classe!

  • Vetores Trigonométricas Unitárias:
    [; \underline{e}(\theta)=\left( \begin{array}{c} \cos{\theta} \\ \sin{\theta} \end{array} \right) \quad \underline{f}(\theta)=\left( \begin{array}{c} -\sin{\theta} \\ \cos{\theta} \end{array} \right) = \widehat{\underline{e}}(\theta) ;]
  • Relações:
    [; \underline{e}'(\theta)= \widehat{\underline{e}}(\theta)=\underline{f}(\theta) ;]

    [; \underline{f}'(\theta)=-\widehat{\underline{f}}(\theta)=-\underline{e}(\theta) ;]

    [; \left( \underline{e}(\theta),\underline{f}(\theta) \right) ;] formam uma base de [; \mathbb{R}^2 ;] também orientada postivamente.
    Python Listing: ../../Code/Vector.py.
    def e(t):
        return Vector([
            cos(t),
            sin(t)
        ])
    
    def f(t):
        #e's complement (normal)
        return Vector([
            -sin(t),
            cos(t)
        ])
    
    
  • Outro par de Vetores Unitárias:
    [; \underline{p}(\theta)=\left( \begin{array}{c} \cos{\theta} \\ -\sin{\theta} \end{array} \right) \quad \underline{q}(\theta)=\left( \begin{array}{c} \sin{\theta} \\ \cos{\theta} \end{array} \right) = \widehat{\underline{p}}(\theta) ;]
  • Relações:
    [; \underline{p}'(\theta)= \widehat{\underline{p}}(\theta)=\underline{q}(\theta) ;]

    [; \underline{q}'(\theta)=-\widehat{\underline{q}}(\theta)=-\underline{p}(\theta) ;]

    [;\left( \underline{p}(\theta),\underline{q}(\theta) \right) ;] forma um base ortogonal, porém com orientação oposta
    Python Listing: ../../Code/Vector.py.
    def p(t):
        return Vector([
            cos(t),
            -sin(t)
        ])
    
    def q(t):
        #q's complement (normal)
        return Vector([
            sin(t),
            cos(t)
        ])
    
    
    
Messages:
0 secs.