VETORES

Jedson · updated December 11, 2023
program VETORES
Implicit None
    Integer(4)::i
    Real(8), Dimension(3)::u,v, vetorial
    Real(8):: ESCALAR
    READ(*,*) u(1),u(2),u(3)
    READ(*,*)
    READ(*,*) v(1),v(2),v(3)

    write(*,*) u
    write(*,*) v
    !PRODUTO ESCALAR
    ESCALAR = u(1)*v(1)+u(2)*v(2)+u(3)*v(3)
    write(*,*)ESCALAR

    !PRODUTO VETORIAL
    vetorial (1)=u(2)*v(3)-u(3)*v(2)
    vetorial (2)=u(3)*v(1)-u(1)*v(3)
    vetorial (3)=u(1)*v(2)-u(2)*v(1)
    write (*,*) vetorial
    
end program VETORES
Output

Comments

Please sign up or log in to contribute to the discussion.